Struct MongoCursor
Represents a cursor for a MongoDB query.
struct MongoCursor(DocType)
;
Use foreach( doc; cursor ) to iterate over the list of documents.
This struct uses reference counting to destroy the underlying MongoDB cursor.
Constructors
Name | Description |
this
(client, collection, flags, nskip, nret, query, return_field_selector)
|
|
this
(client, collection, cursor, existing_documents)
|
|
this
(client, database, collection, query, options)
|
|
this
(client, command, batchSize, getMoreMaxTime)
|
|
Fields
Name | Type | Description |
m_data
|
IMongoCursorData!DocType | |
Properties
Name | Type | Description |
empty [get]
|
bool | Returns true if there are no more documents for this cursor.
|
front [get]
|
DocType | Returns the current document of the response.
|
Methods
Name | Description |
byPair
()
|
Iterates over all remaining documents.
|
limit
(count)
|
Limits the number of documents that the cursor returns.
|
popFront
()
|
Advances the cursor to the next document of the response.
|
skip
(count)
|
Skips a given number of elements at the beginning of the cursor.
|
sort
(order)
|
Controls the order in which the query returns matching documents.
|