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.
private int m_refCountprivate MongoClient m_clientprivate string m_collectionprivate long m_cursorprivate long m_nskipprivate int m_nretprivate Bson m_sortprivate int m_offsetprivate size_t m_currentDocprivate DocType[] m_documentsprivate bool m_iterationStartedprivate long 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.
private int m_refCountprivate MongoClient m_clientprivate Bson m_findQueryprivate string m_databaseprivate string m_nsprivate string m_collectionprivate long m_cursorprivate int m_batchSizeprivate Duration m_maxTimeprivate long m_totalReceivedprivate size_t m_readDocprivate size_t m_insertDocprivate DocType[] m_documentsprivate bool m_iterationStartedprivate long 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)