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, org.bson.conversions.Bson filter) Creates a model for deleting all documents from thenamespacematching thefilter.deleteMany(MongoNamespace namespace, org.bson.conversions.Bson filter, ClientDeleteManyOptions options) Creates a model for deleting all documents from thenamespacematching thefilter.deleteOne(MongoNamespace namespace, org.bson.conversions.Bson filter) Creates a model for deleting at most one document from thenamespacematching thefilter.deleteOne(MongoNamespace namespace, org.bson.conversions.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, org.bson.conversions.Bson filter, TDocument replacement) Creates a model for replacing at most one document in thenamespacematching thefilter.static <TDocument>
ClientNamespacedReplaceOneModelreplaceOne(MongoNamespace namespace, org.bson.conversions.Bson filter, TDocument replacement, ClientReplaceOneOptions options) Creates a model for replacing at most one document in thenamespacematching thefilter.updateMany(MongoNamespace namespace, org.bson.conversions.Bson filter, Iterable<? extends org.bson.conversions.Bson> updatePipeline) Creates a model for updating all documents in thenamespacematching thefilter.updateMany(MongoNamespace namespace, org.bson.conversions.Bson filter, Iterable<? extends org.bson.conversions.Bson> updatePipeline, ClientUpdateManyOptions options) Creates a model for updating all documents in thenamespacematching thefilter.updateMany(MongoNamespace namespace, org.bson.conversions.Bson filter, org.bson.conversions.Bson update) Creates a model for updating all documents in thenamespacematching thefilter.updateMany(MongoNamespace namespace, org.bson.conversions.Bson filter, org.bson.conversions.Bson update, ClientUpdateManyOptions options) Creates a model for updating all documents in thenamespacematching thefilter.updateOne(MongoNamespace namespace, org.bson.conversions.Bson filter, Iterable<? extends org.bson.conversions.Bson> updatePipeline) Creates a model for updating at most one document in thenamespacematching thefilter.updateOne(MongoNamespace namespace, org.bson.conversions.Bson filter, Iterable<? extends org.bson.conversions.Bson> updatePipeline, ClientUpdateOneOptions options) Creates a model for updating at most one document in thenamespacematching thefilter.updateOne(MongoNamespace namespace, org.bson.conversions.Bson filter, org.bson.conversions.Bson update) Creates a model for updating at most one document in thenamespacematching thefilter.updateOne(MongoNamespace namespace, org.bson.conversions.Bson filter, org.bson.conversions.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
static ClientNamespacedUpdateOneModel updateOne(MongoNamespace namespace, org.bson.conversions.Bson filter, org.bson.conversions.Bson update) 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, org.bson.conversions.Bson filter, org.bson.conversions.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, org.bson.conversions.Bson filter, Iterable<? extends org.bson.conversions.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, org.bson.conversions.Bson filter, Iterable<? extends org.bson.conversions.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, org.bson.conversions.Bson filter, org.bson.conversions.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, org.bson.conversions.Bson filter, org.bson.conversions.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, org.bson.conversions.Bson filter, Iterable<? extends org.bson.conversions.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, org.bson.conversions.Bson filter, Iterable<? extends org.bson.conversions.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, org.bson.conversions.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, org.bson.conversions.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
static ClientNamespacedDeleteOneModel deleteOne(MongoNamespace namespace, org.bson.conversions.Bson filter) 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, org.bson.conversions.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
static ClientNamespacedDeleteManyModel deleteMany(MongoNamespace namespace, org.bson.conversions.Bson filter) 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, org.bson.conversions.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:
 
 
 -