There limit results? #7

Closed
andrefagundes10 opened this Issue Jul 18, 2014 · 2 comments

2 participants

@andrefagundes10

In the collection "tmp", there are 1666 documents, but when I try to list everything, shows me only 1000.

http://pastebin.com/iDSsTDVp

@mchacki

Hi,
this behaviour is intended by ArangoDB. There is a batch size limit (by default this is 1000). With this limit ArangoDB returns at most this amount of Documents in one request, but set an indicator that there are more.
Your result object looks like this:

{
  hasMore: true,
  result [Array(1000)],
 ....
}

Within the driver you have to iterate through this cursor. This is either possible using the skip option, or in the AQL query case, you can use the next function attached to the Promise.
See the attached code snippet for a working example:

http://pastebin.com/DAy2vBcP

Alternatively you can send your own batchSize in the options object for the simple queries.

Hope this helps.

@mchacki mchacki closed this Jul 22, 2014
@andrefagundes10

Thank you Michael! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment