Hi,
there are two reasons why we hesitate to offer this functionality. One is the 
cluster, which you have mentioned. The other is that AQL intentionally has no 
mutable state (variables) because it is a descriptive language and for example 
does not guarantee any order in FOR statements. This allows more optimizations, 
in particular in a distributed system.
However, in a sense we do offer what you want, since we provide a list of 
results. So client side, you can easily add a sequence number simply by taking 
the index in the list. With batches you would have to keep a total, but this is 
usually no problem at the client side.
Furthermore, you could have a little Foxx app, which does what you want by 
playing exactly that trick. You might have a little trouble keeping the state 
from one batch to the next, but this could for example also be done client side 
by having a count in the API.
Cheers,
  Max

Am 28. September 2018 05:26:00 MESZ schrieb carthagek...@gmail.com:
>Hi,
>
>Is there a rownum function to be able to assign a row number to every 
>record returned from a query?
>
>Say I have two documents: {fname: fname1, lname: lname1} and {fname: 
>fname2, lname: lname2}
>
>Is it possible to do something of the sort and get the output like
>below?
>
>for d in mycoll
>return {myrownnum: ROW_NUMBER(), fname: d.fname, lname: d.lname}
>
>Expected output:
>
>{myrownum: 0, fname: fname1, lname: lname1}
>{myrownum: 1, fname: fname2, lname: lname2}
>
>I understand that it would probably not work (i.e. would give wrong
>rownums 
>or plainly not work) in a clustered environment and that you haven't 
>specified the shard keys completely. But I think it should b possible
>when 
>you hit a single shard.

-- 
You received this message because you are subscribed to the Google Groups 
"ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to arangodb+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to