MongoCursor

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.

Constructors

this
deprecated this(MongoClient client, string collection, QueryFlags flags, int nskip, int nret, Q query, S return_field_selector)
Undocumented in source.
this
deprecated this(MongoClient client, string collection, long cursor, DocType[] existing_documents)
Undocumented in source.
this
this(MongoClient client, string database, string collection, Q query, FindOptions options)
Undocumented in source.
this
this(MongoClient client, Bson command, int batchSize, Duration getMoreMaxTime)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Functions

byPair
auto byPair()

Iterates over all remaining documents.

limit
MongoCursor limit(long count)

Limits the number of documents that the cursor returns.

popFront
void popFront()

Advances the cursor to the next document of the response.

skip
MongoCursor skip(long count)

Skips a given number of elements at the beginning of the cursor.

sort
MongoCursor sort(T order)

Controls the order in which the query returns matching documents.

Properties

empty
bool empty [@property getter]

Returns true if there are no more documents for this cursor.

front
DocType front [@property getter]

Returns the current document of the response.

Meta