vibe.db.mongo.cursor
MongoDB cursor abstraction
Copyright
Types 6
Represents a cursor for a MongoDB query.
Use foreach( doc; cursor ) to iterate over the list of documents.
This struct uses reference counting to destroy the underlying MongoDB cursor.
private IMongoCursorData!DocType m_dataMongoCursor sort(T)(T order)Controls the order in which the query returns matching documents.MongoCursor limit(long count)Limits the number of documents that the cursor returns.MongoCursor skip(long count)Skips a given number of elements at the beginning of the cursor.void popFront()Advances the cursor to the next document of the response.auto byPair()Iterates over all remaining documents.this(MongoClient client, string collection, QueryFlags flags, int nskip, int nret, Q query, S return_field_selector)this(MongoClient client, string collection, long cursor, DocType[] existing_documents)this(MongoClient client, string database, string collection, Q query, FindOptions options)this(MongoClient client, Bson command, int batchSize = 0, Duration getMoreMaxTime = Duration.max)Actual iteration implementation details for MongoCursor. Abstracted using an interface because we still have code for legacy (<3.6) MongoDB servers, which may still used with the old legacy overloads.
bool empty() @safelong index() @safeDocType front() @safevoid popFront() @safevoid killCursors() @safeKills the MongoDB cursor, further iteration attempts will result in errors. Call this in the destructor.int refCount() ref @safeDefine an reference count property on the class, which is returned by reference with this method.Deprecated query internals exposed through MongoCursor.
int m_refCountMongoClient m_clientstring m_collectionlong m_cursorlong m_nskipint m_nretBson m_sortint m_offsetsize_t m_currentDocDocType[] m_documentsbool m_iterationStartedlong m_limitbool empty() @safelong index() @safeDocType front() @safevoid sort(Bson order) @safevoid limit(long count) @safevoid skip(long count) @safevoid popFront() @safevoid startIterating() @safevoid killCursors() @safevoid handleReply(long cursor, ReplyFlags flags, int first_doc, int num_docs)void handleDocument(size_t idx, ref DocType doc)int refCount() refFind + getMore internals exposed through MongoCursor. Unifies the old LegacyMongoCursorData approach, so it can be used both for find queries and for custom commands.
int m_refCountMongoClient m_clientBson m_findQuerystring m_databasestring m_nsstring m_collectionlong m_cursorint m_batchSizeDuration m_maxTimelong m_totalReceivedsize_t m_readDocsize_t m_insertDocDocType[] m_documentsbool m_iterationStartedlong m_queryLimitbool empty() @safelong index() @safeDocType front() @safevoid sort(Bson order) @safevoid limit(long count) @safevoid skip(long count) @safevoid popFront() @safevoid killCursors() @safevoid handleReply(long id, string ns, size_t count)void handleDocument(ref DocType doc)int refCount() refthis(MongoClient client, Bson command, int batchSize = 0, Duration getMoreMaxTime = Duration.max)Internal class implementing MongoCursorData for find queries
void startIterating() @safethis(MongoClient client, string collection, QueryFlags flags, int nskip, int nret, Q query, S return_field_selector)Internal class implementing MongoCursorData for already initialized generic cursors
void startIterating() @safethis(MongoClient client, string collection, long cursor, DocType[] existing_documents)