ArangoDB-Community / arangodb-net-standard

A consistent, comprehensive, minimal interface to enable .NET applications to use the complete range of features exposed by the ArangoDB REST API.
Apache License 2.0
76 stars 30 forks source link

Question: How to Query multiple batches #490

Closed AceTheWiz closed 6 months ago

AceTheWiz commented 6 months ago

How can I query multiple batches ?

AceTheWiz commented 6 months ago

How can I query multiple batches ?

I solved it.

CursorResponse<ObjId> qrObjIds;
List<ObjId> objIds = new();

qrObjIds = await adb.Cursor.PostCursorAsync<ObjId>(
    """
    FOR d IN `req-sw` 
    RETURN {Key:d._key, Id:d.AbsId}
    """);

objIds.AddRange(qrObjIds.Result);

do
{
   qrObjIds = await adb.Cursor.PostAdvanceCursorAsync<ObjId>(qrObjIds.Id);
   objIds.AddRange(qrObjIds.Result);
} while (qrObjIds.HasMore);
AceTheWiz commented 6 months ago

Solved.