Package com.mongodb.client.model.bulk
Interface ClientNamespacedWriteModel
- All Known Subinterfaces:
ClientNamespacedDeleteManyModel
,ClientNamespacedDeleteOneModel
,ClientNamespacedInsertOneModel
,ClientNamespacedReplaceOneModel
,ClientNamespacedUpdateManyModel
,ClientNamespacedUpdateOneModel
A combination of an individual write operation and a namespace
the operation is targeted at.
- Since:
- 5.3
-
Method Summary
Modifier and TypeMethodDescriptiondeleteMany
(MongoNamespace namespace, Bson filter) Creates a model for deleting all documents from thenamespace
matching thefilter
.deleteMany
(MongoNamespace namespace, Bson filter, ClientDeleteManyOptions options) Creates a model for deleting all documents from thenamespace
matching thefilter
.deleteOne
(MongoNamespace namespace, Bson filter) Creates a model for deleting at most one document from thenamespace
matching thefilter
.deleteOne
(MongoNamespace namespace, Bson filter, ClientDeleteOneOptions options) Creates a model for deleting at most one document from thenamespace
matching thefilter
.static <TDocument>
ClientNamespacedInsertOneModelinsertOne
(MongoNamespace namespace, TDocument document) Creates a model for inserting thedocument
into thenamespace
.static <TDocument>
ClientNamespacedReplaceOneModelreplaceOne
(MongoNamespace namespace, Bson filter, TDocument replacement) Creates a model for replacing at most one document in thenamespace
matching thefilter
.static <TDocument>
ClientNamespacedReplaceOneModelreplaceOne
(MongoNamespace namespace, Bson filter, TDocument replacement, ClientReplaceOneOptions options) Creates a model for replacing at most one document in thenamespace
matching thefilter
.updateMany
(MongoNamespace namespace, Bson filter, Iterable<? extends Bson> updatePipeline) Creates a model for updating all documents in thenamespace
matching thefilter
.updateMany
(MongoNamespace namespace, Bson filter, Iterable<? extends Bson> updatePipeline, ClientUpdateManyOptions options) Creates a model for updating all documents in thenamespace
matching thefilter
.updateMany
(MongoNamespace namespace, Bson filter, Bson update) Creates a model for updating all documents in thenamespace
matching thefilter
.updateMany
(MongoNamespace namespace, Bson filter, Bson update, ClientUpdateManyOptions options) Creates a model for updating all documents in thenamespace
matching thefilter
.updateOne
(MongoNamespace namespace, Bson filter, Iterable<? extends Bson> updatePipeline) Creates a model for updating at most one document in thenamespace
matching thefilter
.updateOne
(MongoNamespace namespace, Bson filter, Iterable<? extends Bson> updatePipeline, ClientUpdateOneOptions options) Creates a model for updating at most one document in thenamespace
matching thefilter
.updateOne
(MongoNamespace namespace, Bson filter, Bson update) Creates a model for updating at most one document in thenamespace
matching thefilter
.updateOne
(MongoNamespace namespace, Bson filter, Bson update, ClientUpdateOneOptions options) Creates a model for updating at most one document in thenamespace
matching thefilter
.
-
Method Details
-
insertOne
static <TDocument> ClientNamespacedInsertOneModel insertOne(MongoNamespace namespace, TDocument document) Creates a model for inserting thedocument
into thenamespace
.- Type Parameters:
TDocument
- The document type, for exampleDocument
.- Parameters:
namespace
- The namespace.document
- The document.- Returns:
- The requested
ClientNamespacedInsertOneModel
.
-
updateOne
Creates a model for updating at most one document in thenamespace
matching thefilter
. This method is functionally equivalent toupdateOne(MongoNamespace, Bson, Bson, ClientUpdateOneOptions)
with the default options.- Parameters:
namespace
- The namespace.filter
- The filter.update
- The update.- Returns:
- The requested
ClientNamespacedUpdateOneModel
. - See Also:
-
updateOne
static ClientNamespacedUpdateOneModel updateOne(MongoNamespace namespace, Bson filter, Bson update, ClientUpdateOneOptions options) Creates a model for updating at most one document in thenamespace
matching thefilter
.- Parameters:
namespace
- The namespace.filter
- The filter.update
- The update.options
- The options.- Returns:
- The requested
ClientNamespacedUpdateOneModel
. - See Also:
-
updateOne
static ClientNamespacedUpdateOneModel updateOne(MongoNamespace namespace, Bson filter, Iterable<? extends Bson> updatePipeline) Creates a model for updating at most one document in thenamespace
matching thefilter
. This method is functionally equivalent toupdateOne(MongoNamespace, Bson, Iterable, ClientUpdateOneOptions)
with the default options.- Parameters:
namespace
- The namespace.filter
- The filter.updatePipeline
- The update pipeline.- Returns:
- The requested
ClientNamespacedUpdateOneModel
. - See Also:
-
updateOne
static ClientNamespacedUpdateOneModel updateOne(MongoNamespace namespace, Bson filter, Iterable<? extends Bson> updatePipeline, ClientUpdateOneOptions options) Creates a model for updating at most one document in thenamespace
matching thefilter
.- Parameters:
namespace
- The namespace.filter
- The filter.updatePipeline
- The update pipeline.options
- The options.- Returns:
- The requested
ClientNamespacedUpdateOneModel
. - See Also:
-
updateMany
static ClientNamespacedUpdateManyModel updateMany(MongoNamespace namespace, Bson filter, Bson update) Creates a model for updating all documents in thenamespace
matching thefilter
. This method is functionally equivalent toupdateMany(MongoNamespace, Bson, Bson, ClientUpdateManyOptions)
with the default.- Parameters:
namespace
- The namespace.filter
- The filter.update
- The update.- Returns:
- The requested
ClientNamespacedUpdateManyModel
. - See Also:
-
updateMany
static ClientNamespacedUpdateManyModel updateMany(MongoNamespace namespace, Bson filter, Bson update, ClientUpdateManyOptions options) Creates a model for updating all documents in thenamespace
matching thefilter
.- Parameters:
namespace
- The namespace.filter
- The filter.update
- The update.options
- The options.- Returns:
- The requested
ClientNamespacedUpdateManyModel
. - See Also:
-
updateMany
static ClientNamespacedUpdateManyModel updateMany(MongoNamespace namespace, Bson filter, Iterable<? extends Bson> updatePipeline) Creates a model for updating all documents in thenamespace
matching thefilter
. This method is functionally equivalent toupdateMany(MongoNamespace, Bson, Iterable, ClientUpdateManyOptions)
with the default options.- Parameters:
namespace
- The namespace.filter
- The filter.updatePipeline
- The update pipeline.- Returns:
- The requested
ClientNamespacedUpdateManyModel
. - See Also:
-
updateMany
static ClientNamespacedUpdateManyModel updateMany(MongoNamespace namespace, Bson filter, Iterable<? extends Bson> updatePipeline, ClientUpdateManyOptions options) Creates a model for updating all documents in thenamespace
matching thefilter
.- Parameters:
namespace
- The namespace.filter
- The filter.updatePipeline
- The update pipeline.options
- The options.- Returns:
- The requested
ClientNamespacedUpdateManyModel
. - See Also:
-
replaceOne
static <TDocument> ClientNamespacedReplaceOneModel replaceOne(MongoNamespace namespace, Bson filter, TDocument replacement) Creates a model for replacing at most one document in thenamespace
matching thefilter
. This method is functionally equivalent toreplaceOne(MongoNamespace, Bson, Object, ClientReplaceOneOptions)
with the default options.- Type Parameters:
TDocument
- The document type, for exampleDocument
.- Parameters:
namespace
- The namespace.filter
- The filter.replacement
- The replacement. The keys of this document must not start with$
, unless they express a database reference.- Returns:
- The requested
ClientNamespacedReplaceOneModel
. - See Also:
-
replaceOne
static <TDocument> ClientNamespacedReplaceOneModel replaceOne(MongoNamespace namespace, Bson filter, TDocument replacement, ClientReplaceOneOptions options) Creates a model for replacing at most one document in thenamespace
matching thefilter
.- Type Parameters:
TDocument
- The document type, for exampleDocument
.- Parameters:
namespace
- The namespace.filter
- The filter.replacement
- The replacement. The keys of this document must not start with$
, unless they express a database reference.options
- The options.- Returns:
- The requested
ClientNamespacedReplaceOneModel
. - See Also:
-
deleteOne
Creates a model for deleting at most one document from thenamespace
matching thefilter
. This method is functionally equivalent todeleteOne(MongoNamespace, Bson, ClientDeleteOneOptions)
with the default options.- Parameters:
namespace
- The namespace.filter
- The filter.- Returns:
- The requested
ClientNamespacedDeleteOneModel
. - See Also:
-
deleteOne
static ClientNamespacedDeleteOneModel deleteOne(MongoNamespace namespace, Bson filter, ClientDeleteOneOptions options) Creates a model for deleting at most one document from thenamespace
matching thefilter
.- Parameters:
namespace
- The namespace.filter
- The filter.options
- The options.- Returns:
- The requested
ClientNamespacedDeleteOneModel
. - See Also:
-
deleteMany
Creates a model for deleting all documents from thenamespace
matching thefilter
. This method is functionally equivalent todeleteMany(MongoNamespace, Bson, ClientDeleteManyOptions)
with the default options.- Parameters:
namespace
- The namespace.filter
- The filter.- Returns:
- The requested
ClientNamespacedDeleteManyModel
. - See Also:
-
deleteMany
static ClientNamespacedDeleteManyModel deleteMany(MongoNamespace namespace, Bson filter, ClientDeleteManyOptions options) Creates a model for deleting all documents from thenamespace
matching thefilter
.- Parameters:
namespace
- The namespace.filter
- The filter.options
- The options.- Returns:
- The requested
ClientNamespacedDeleteManyModel
. - See Also:
-