wow, still unleashing the power of Gremlin. Tested in OrientDB and it
works.
Thanks Boris, Daniel and Pierre,
Adolfo
On Aug 12, 5:59 pm, Pierre De Wilde <
pierredewi...@gmail.com> wrote:
> Hi,
>
> Marko would said: what a beautiful name you have! Hopefully, he is on
> holidays...
>
> As Daniel suggested, the way to transform DATE into YYYY-MM-DD is the
> transform{} step.
>
> If DATE is a string:
>
> .transform{it.DATE.substring(0,10)}
> ==>2011-08-05
>
> If DATE is a date:
>
> .transform{sprintf("%d-%02d-%02d", it.DATE.getYear()+1900,
> it.DATE.getMonth()+1, it.DATE.getDay())}
> ==>2011-08-05
>
> HTH,
> Pierre
>
> 2011/8/12 Boris Kizelshteyn <
boris.kizelsht...@popcha.com>
>
>
>
>
>
>
>
> > Hi Adolfo,
>
> > This is not a direct answer to your question, but perhaps it will help in
> > some way: when working with dates I find it useful to work with epoch time
> > stamps, that way you can sort and count ints rather than date objects. If
> > you could get the date into epoch format before you run gremlin it should
> > work just fine. Maybe something to consider until someone who knows java
> > gets back to you (I'm a python hacker myself ;))
>
> > Best!
>
> > On Fri, Aug 12, 2011 at 10:48 AM, Adolfo Rodriguez <
pellyado...@yahoo.es>wrote:
>
> >> Hi all,
>
> >> lets assume a Gremlin expression as below:
>
> >> resultsMap = [:]
>
> >> sourceNode.in("some").outE("arbitrarily").inV("long").out("traversal").DATE .groupCount(resultsMap)
>
> >> I am trying to count the number of repeats for each day in my records.
> >> However, my date fields come as "yyyy-MM-dd HH:mm:ss".
> >> I would need some way in Gremlin to format this date (in my case to
> >> remove the time) to feed groupCount method.
>
> >> Something as:
>
> >> sourceNode.in("some").outE("arbitrarily").inV("long").out("traversal").DATE .format("yyyy-