Counts matching documents.
The match filter
Optionaloptions: MongoOptions
The operation options (e.g. a session)
The matching count
Deletes matching documents.
The match filter
Optionaloptions: MongoOptions
The operation options (e.g. a session)
{ deletedCount }
Finds matching documents.
The match filter
Optionaloptions: MongoOptions & {The find options (sort/skip/limit/projection)
Optionallimit?: numberOptionalprojection?: Record<string, 0 | 1>Optionalskip?: numberOptionalsort?: unknownDeliberately unknown — see IMongoCollection.findOne: the
real Sort union admits strings and arrays, which a Record typing
rejected.
A cursor that materializes the matching documents with toArray()
Finds a single document.
The match filter
Optionaloptions: MongoOptions & { projection?: Record<string, 0 | 1>; sort?: unknown }
The findOne options (projection/sort)
Optionalprojection?: Record<string, 0 | 1>Optionalsort?: unknownDeliberately unknown: the real driver's FindOptions.sort is the
Sort union, which admits bare strings and arrays, so a
Record<string, unknown> here made the real collection fail this
member (X47-1). The adapter builds a Record and the real driver
accepts it; unknown keeps both assignable.
The matching document, or null
Finds one document and applies an update, returning the updated document.
The match filter
The update document ($set form)
The findOneAndUpdate options
The updated document, or null when none matched
Inserts one document.
The document to insert
Optionaloptions: MongoOptions
The insertOne options (e.g. a session)
{ acknowledged, insertedId }, insertedId an ObjectId
A structural subset of the driver
Collection— the methods the data source calls to serve the sixIDataSourcemethods.The adapter reads the driver's documented return shapes (see the milestone's §1.1:
insertOne→{ acknowledged, insertedId },findOneAndUpdate→ the document directly,deleteOne→{ deletedCount }) rather than the driver's own classes, so a faithful test double that reproduces those shapes is assignable here — the recurring contract-violating double this seam exists to prevent.Since
0.2.0