Available on crate features
sync
or tokio-sync
only.Expand description
Contains the sync API. This is only available when the sync
feature is enabled.
Modules§
- Contains the functionality for GridFS operations.
Structs§
- A
ChangeStream
streams the ongoing changes of its associated collection, database or deployment.ChangeStream
instances should be created with methodwatch
against the relevant target. - This is the main entry point for the synchronous API. A
Client
is used to connect to a MongoDB cluster. By default, it will monitor the topology of the cluster, keeping track of any changes, such as servers being added or removed. - A MongoDB client session. This struct represents a logical session used for ordering sequential operations. To create a
ClientSession
, callstart_session
on aClient
. Collection
is the client-side abstraction of a MongoDB Collection. It can be used to perform collection-level operations such as CRUD operations. ACollection
can be obtained through aDatabase
by calling eitherDatabase::collection
orDatabase::collection_with_options
.- A
Cursor
streams the result of a query. When a query is made, aCursor
will be returned with the first batch of results from the server; the documents will be returned as theCursor
is iterated. When the batch is exhausted and if there are more results, theCursor
will fetch the next batch of documents, and so forth until the results are exhausted. Note that because of this batching, additional network I/O may occur on any given call toCursor::next
. Because of this, aCursor
iterates overResult<Document>
items rather than simplyDocument
items. Database
is the client-side abstraction of a MongoDB database. It can be used to perform database-level operations or to obtain handles to specific collections within the database. ADatabase
can only be obtained through aClient
by calling eitherClient::database
orClient::database_with_options
.- A
SessionChangeStream
is a change stream that was created with aClientSession
that must be iterated using one. To iterate, useSessionChangeStream::next
: - A
SessionCursor
is a cursor that was created with aClientSession
must be iterated using one. To iterate, retrieve a [SessionCursorIter]
usingSessionCursor::iter
: - A handle that borrows a
ClientSession
temporarily for executing getMores or iterating through the current buffer of aSessionCursor
.