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
Static MethodsModifier and TypeMethodDescriptiondeleteMany(MongoNamespace namespace, Bson filter) Creates a model for deleting all documents from thenamespacematching thefilter.deleteMany(MongoNamespace namespace, Bson filter, ClientDeleteManyOptions options) Creates a model for deleting all documents from thenamespacematching thefilter.deleteOne(MongoNamespace namespace, Bson filter) Creates a model for deleting at most one document from thenamespacematching thefilter.deleteOne(MongoNamespace namespace, Bson filter, ClientDeleteOneOptions options) Creates a model for deleting at most one document from thenamespacematching thefilter.static <TDocument>
ClientNamespacedInsertOneModelinsertOne(MongoNamespace namespace, TDocument document) Creates a model for inserting thedocumentinto thenamespace.static <TDocument>
ClientNamespacedReplaceOneModelreplaceOne(MongoNamespace namespace, Bson filter, TDocument replacement) Creates a model for replacing at most one document in thenamespacematching thefilter.static <TDocument>
ClientNamespacedReplaceOneModelreplaceOne(MongoNamespace namespace, Bson filter, TDocument replacement, ClientReplaceOneOptions options) Creates a model for replacing at most one document in thenamespacematching thefilter.updateMany(MongoNamespace namespace, Bson filter, Iterable<? extends Bson> updatePipeline) Creates a model for updating all documents in thenamespacematching thefilter.updateMany(MongoNamespace namespace, Bson filter, Iterable<? extends Bson> updatePipeline, ClientUpdateManyOptions options) Creates a model for updating all documents in thenamespacematching thefilter.updateMany(MongoNamespace namespace, Bson filter, Bson update) Creates a model for updating all documents in thenamespacematching thefilter.updateMany(MongoNamespace namespace, Bson filter, Bson update, ClientUpdateManyOptions options) Creates a model for updating all documents in thenamespacematching thefilter.updateOne(MongoNamespace namespace, Bson filter, Iterable<? extends Bson> updatePipeline) Creates a model for updating at most one document in thenamespacematching thefilter.updateOne(MongoNamespace namespace, Bson filter, Iterable<? extends Bson> updatePipeline, ClientUpdateOneOptions options) Creates a model for updating at most one document in thenamespacematching thefilter.updateOne(MongoNamespace namespace, Bson filter, Bson update) Creates a model for updating at most one document in thenamespacematching thefilter.updateOne(MongoNamespace namespace, Bson filter, Bson update, ClientUpdateOneOptions options) Creates a model for updating at most one document in thenamespacematching thefilter.
-
Method Details
-
insertOne
static <TDocument> ClientNamespacedInsertOneModel insertOne(MongoNamespace namespace, TDocument document) Creates a model for inserting thedocumentinto 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 thenamespacematching 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 thenamespacematching 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 thenamespacematching 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 thenamespacematching 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 thenamespacematching 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 thenamespacematching 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 thenamespacematching 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 thenamespacematching 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 thenamespacematching 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 thenamespacematching 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 thenamespacematching 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 thenamespacematching 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 thenamespacematching 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 thenamespacematching thefilter.- Parameters:
namespace- The namespace.filter- The filter.options- The options.- Returns:
- The requested
ClientNamespacedDeleteManyModel. - See Also:
-