azure - Is it possible to asynchronously query DocumentDB for all documents (i.e no paging)? -


is possible, using documentdb .net sdk, make run asynchronous query against db returns matching documents?

the answer answer stackoverflow question: querying azure documentdb executenextasync returns fewer maxitemcount indicates that:

there limits how long query execute on documentdb.
...
if these limits hit, partial set of results may returned.

i know it's possible overcome above mentioned limit iterating on paged results so: (source)

list<family> families = new list<family>();  feedoptions options = new feedoptions { maxitemcount = 1 };  var query = client.createdocumentquery<family>(collectionlink, options).asdocumentquery();  while (query.hasmoreresults) {     foreach (family family in await query.executenextasync())     {         families.add(family);     } } 

my question - loop necessary? might there more elegant way tell sdk return results available (without paging)?

the loop have best way perform enumerating across multiple requests since there bounded time execution on each request in documentdb.

you wrap code in extension method make handy.

this suggestion documentdb team add support - https://github.com/azure/azure-documentdb-dotnet/issues


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -