Interface MongoCollection<TDocument>
-
public interface MongoCollection<TDocument>
The MongoCollection interface.Note: Additions to this interface will not be considered to break binary compatibility.
- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MongoCollectionResult<TDocument>
aggregate(JsonArray pipeline)
Aggregates documents according to the specified aggregation pipeline.MongoCollectionResult<TDocument>
aggregate(JsonArray pipeline, AggregateOptions options)
Aggregates documents according to the specified aggregation pipeline.MongoCollectionResult<TDocument>
aggregate(ClientSession clientSession, JsonArray pipeline)
Aggregates documents according to the specified aggregation pipeline.MongoCollectionResult<TDocument>
aggregate(ClientSession clientSession, JsonArray pipeline, AggregateOptions options)
Aggregates documents according to the specified aggregation pipeline.Future<BulkWriteResult>
bulkWrite(ClientSession clientSession, java.util.List<? extends WriteModel<? extends TDocument>> requests)
Executes a mix of inserts, updates, replaces, and deletes.void
bulkWrite(ClientSession clientSession, java.util.List<? extends WriteModel<? extends TDocument>> requests, Handler<AsyncResult<BulkWriteResult>> resultHandler)
Executes a mix of inserts, updates, replaces, and deletes.Future<BulkWriteResult>
bulkWrite(ClientSession clientSession, java.util.List<? extends WriteModel<? extends TDocument>> requests, BulkWriteOptions options)
Executes a mix of inserts, updates, replaces, and deletes.void
bulkWrite(ClientSession clientSession, java.util.List<? extends WriteModel<? extends TDocument>> requests, BulkWriteOptions options, Handler<AsyncResult<BulkWriteResult>> resultHandler)
Executes a mix of inserts, updates, replaces, and deletes.Future<BulkWriteResult>
bulkWrite(java.util.List<? extends WriteModel<? extends TDocument>> requests)
Executes a mix of inserts, updates, replaces, and deletes.void
bulkWrite(java.util.List<? extends WriteModel<? extends TDocument>> requests, Handler<AsyncResult<BulkWriteResult>> resultHandler)
Executes a mix of inserts, updates, replaces, and deletes.Future<BulkWriteResult>
bulkWrite(java.util.List<? extends WriteModel<? extends TDocument>> requests, BulkWriteOptions options)
Executes a mix of inserts, updates, replaces, and deletes.void
bulkWrite(java.util.List<? extends WriteModel<? extends TDocument>> requests, BulkWriteOptions options, Handler<AsyncResult<BulkWriteResult>> resultHandler)
Executes a mix of inserts, updates, replaces, and deletes.Future<java.lang.Long>
countDocuments()
Counts the number of documents in the collection.void
countDocuments(Handler<AsyncResult<java.lang.Long>> resultHandler)
Counts the number of documents in the collection.Future<java.lang.Long>
countDocuments(JsonObject filter)
Counts the number of documents in the collection according to the given options.void
countDocuments(JsonObject filter, Handler<AsyncResult<java.lang.Long>> resultHandler)
Counts the number of documents in the collection according to the given options.Future<java.lang.Long>
countDocuments(JsonObject filter, CountOptions options)
Counts the number of documents in the collection according to the given options.void
countDocuments(JsonObject filter, CountOptions options, Handler<AsyncResult<java.lang.Long>> resultHandler)
Counts the number of documents in the collection according to the given options.Future<java.lang.Long>
countDocuments(ClientSession clientSession)
Counts the number of documents in the collection.void
countDocuments(ClientSession clientSession, Handler<AsyncResult<java.lang.Long>> resultHandler)
Counts the number of documents in the collection.Future<java.lang.Long>
countDocuments(ClientSession clientSession, JsonObject filter)
Counts the number of documents in the collection according to the given options.void
countDocuments(ClientSession clientSession, JsonObject filter, Handler<AsyncResult<java.lang.Long>> resultHandler)
Counts the number of documents in the collection according to the given options.Future<java.lang.Long>
countDocuments(ClientSession clientSession, JsonObject filter, CountOptions options)
Counts the number of documents in the collection according to the given options.void
countDocuments(ClientSession clientSession, JsonObject filter, CountOptions options, Handler<AsyncResult<java.lang.Long>> resultHandler)
Counts the number of documents in the collection according to the given options.Future<java.lang.String>
createIndex(JsonObject key)
Creates an index.void
createIndex(JsonObject key, Handler<AsyncResult<java.lang.String>> resultHandler)
Creates an index.Future<java.lang.String>
createIndex(JsonObject key, IndexOptions options)
Creates an index.void
createIndex(JsonObject key, IndexOptions options, Handler<AsyncResult<java.lang.String>> resultHandler)
Creates an index.Future<java.lang.String>
createIndex(ClientSession clientSession, JsonObject key)
Creates an index.void
createIndex(ClientSession clientSession, JsonObject key, Handler<AsyncResult<java.lang.String>> resultHandler)
Creates an index.Future<java.lang.String>
createIndex(ClientSession clientSession, JsonObject key, IndexOptions options)
Creates an index.void
createIndex(ClientSession clientSession, JsonObject key, IndexOptions options, Handler<AsyncResult<java.lang.String>> resultHandler)
Creates an index.Future<java.lang.String>
createIndexes(ClientSession clientSession, java.util.List<IndexModel> indexes)
Create multiple indexes.void
createIndexes(ClientSession clientSession, java.util.List<IndexModel> indexes, Handler<AsyncResult<java.lang.String>> resultHandler)
Create multiple indexes.Future<java.lang.String>
createIndexes(ClientSession clientSession, java.util.List<IndexModel> indexes, CreateIndexOptions createIndexOptions)
Create multiple indexes.void
createIndexes(ClientSession clientSession, java.util.List<IndexModel> indexes, CreateIndexOptions createIndexOptions, Handler<AsyncResult<java.lang.String>> resultHandler)
Create multiple indexes.Future<java.lang.String>
createIndexes(java.util.List<IndexModel> indexes)
Create multiple indexes.void
createIndexes(java.util.List<IndexModel> indexes, Handler<AsyncResult<java.lang.String>> resultHandler)
Create multiple indexes.Future<java.lang.String>
createIndexes(java.util.List<IndexModel> indexes, CreateIndexOptions createIndexOptions)
Create multiple indexes.void
createIndexes(java.util.List<IndexModel> indexes, CreateIndexOptions createIndexOptions, Handler<AsyncResult<java.lang.String>> resultHandler)
Create multiple indexes.Future<DeleteResult>
deleteMany(JsonObject filter)
Removes all documents from the collection that match the given query filter.void
deleteMany(JsonObject filter, Handler<AsyncResult<DeleteResult>> resultHandler)
Removes all documents from the collection that match the given query filter.Future<DeleteResult>
deleteMany(JsonObject filter, DeleteOptions options)
Removes all documents from the collection that match the given query filter.void
deleteMany(JsonObject filter, DeleteOptions options, Handler<AsyncResult<DeleteResult>> resultHandler)
Removes all documents from the collection that match the given query filter.Future<DeleteResult>
deleteMany(ClientSession clientSession, JsonObject filter)
Removes all documents from the collection that match the given query filter.void
deleteMany(ClientSession clientSession, JsonObject filter, Handler<AsyncResult<DeleteResult>> resultHandler)
Removes all documents from the collection that match the given query filter.Future<DeleteResult>
deleteMany(ClientSession clientSession, JsonObject filter, DeleteOptions options)
Removes all documents from the collection that match the given query filter.void
deleteMany(ClientSession clientSession, JsonObject filter, DeleteOptions options, Handler<AsyncResult<DeleteResult>> resultHandler)
Removes all documents from the collection that match the given query filter.Future<DeleteResult>
deleteOne(JsonObject filter)
Removes at most one document from the collection that matches the given filter.void
deleteOne(JsonObject filter, Handler<AsyncResult<DeleteResult>> resultHandler)
Removes at most one document from the collection that matches the given filter.Future<DeleteResult>
deleteOne(JsonObject filter, DeleteOptions options)
Removes at most one document from the collection that matches the given filter.void
deleteOne(JsonObject filter, DeleteOptions options, Handler<AsyncResult<DeleteResult>> resultHandler)
Removes at most one document from the collection that matches the given filter.Future<DeleteResult>
deleteOne(ClientSession clientSession, JsonObject filter)
Removes at most one document from the collection that matches the given filter.void
deleteOne(ClientSession clientSession, JsonObject filter, Handler<AsyncResult<DeleteResult>> resultHandler)
Removes at most one document from the collection that matches the given filter.Future<DeleteResult>
deleteOne(ClientSession clientSession, JsonObject filter, DeleteOptions options)
Removes at most one document from the collection that matches the given filter.void
deleteOne(ClientSession clientSession, JsonObject filter, DeleteOptions options, Handler<AsyncResult<DeleteResult>> resultHandler)
Removes at most one document from the collection that matches the given filter.Future<java.lang.Void>
drop()
Drops this collection from the Database.void
drop(Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops this collection from the Database.Future<java.lang.Void>
drop(ClientSession clientSession)
Drops this collection from the Database.void
drop(ClientSession clientSession, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops this collection from the Database.Future<java.lang.Void>
dropIndex(JsonObject keys)
Drops the index given the keys used to create it.void
dropIndex(JsonObject keys, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops the index given the keys used to create it.Future<java.lang.Void>
dropIndex(JsonObject keys, DropIndexOptions dropIndexOptions)
Drops the index given the keys used to create it.void
dropIndex(JsonObject keys, DropIndexOptions dropIndexOptions, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops the index given the keys used to create it.Future<java.lang.Void>
dropIndex(ClientSession clientSession, JsonObject keys)
Drops the index given the keys used to create it.void
dropIndex(ClientSession clientSession, JsonObject keys, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops the index given the keys used to create it.Future<java.lang.Void>
dropIndex(ClientSession clientSession, JsonObject keys, DropIndexOptions dropIndexOptions)
Drops the index given the keys used to create it.void
dropIndex(ClientSession clientSession, JsonObject keys, DropIndexOptions dropIndexOptions, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops the index given the keys used to create it.Future<java.lang.Void>
dropIndex(ClientSession clientSession, java.lang.String indexName)
Drops the given index.void
dropIndex(ClientSession clientSession, java.lang.String indexName, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops the given index.Future<java.lang.Void>
dropIndex(ClientSession clientSession, java.lang.String indexName, DropIndexOptions dropIndexOptions)
Drops the given index.void
dropIndex(ClientSession clientSession, java.lang.String indexName, DropIndexOptions dropIndexOptions, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops the given index.Future<java.lang.Void>
dropIndex(java.lang.String indexName)
Drops the given index.void
dropIndex(java.lang.String indexName, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops the given index.Future<java.lang.Void>
dropIndex(java.lang.String indexName, DropIndexOptions dropIndexOptions)
Drops the given index.void
dropIndex(java.lang.String indexName, DropIndexOptions dropIndexOptions, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops the given index.Future<java.lang.Void>
dropIndexes()
Drop all the indexes on this collection, except for the default on _id.void
dropIndexes(Handler<AsyncResult<java.lang.Void>> resultHandler)
Drop all the indexes on this collection, except for the default on _id.Future<java.lang.Void>
dropIndexes(ClientSession clientSession)
Drop all the indexes on this collection, except for the default on _id.void
dropIndexes(ClientSession clientSession, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drop all the indexes on this collection, except for the default on _id.Future<java.lang.Void>
dropIndexes(ClientSession clientSession, DropIndexOptions dropIndexOptions)
Drop all the indexes on this collection, except for the default on _id.void
dropIndexes(ClientSession clientSession, DropIndexOptions dropIndexOptions, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drop all the indexes on this collection, except for the default on _id.Future<java.lang.Void>
dropIndexes(DropIndexOptions dropIndexOptions)
Drop all the indexes on this collection, except for the default on _id.void
dropIndexes(DropIndexOptions dropIndexOptions, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drop all the indexes on this collection, except for the default on _id.Future<java.lang.Long>
estimatedDocumentCount()
Gets an estimate of the count of documents in a collection using collection metadata.void
estimatedDocumentCount(Handler<AsyncResult<java.lang.Long>> resultHandler)
Gets an estimate of the count of documents in a collection using collection metadata.Future<java.lang.Long>
estimatedDocumentCount(EstimatedDocumentCountOptions options)
Gets an estimate of the count of documents in a collection using collection metadata.void
estimatedDocumentCount(EstimatedDocumentCountOptions options, Handler<AsyncResult<java.lang.Long>> resultHandler)
Gets an estimate of the count of documents in a collection using collection metadata.MongoResult<TDocument>
find()
Finds all documents in the collection.MongoResult<TDocument>
find(JsonObject filter)
Finds all documents in the collection.MongoResult<TDocument>
find(JsonObject filter, FindOptions options)
Finds all documents in the collection.MongoResult<TDocument>
find(ClientSession clientSession)
Finds all documents in the collection.MongoResult<TDocument>
find(ClientSession clientSession, JsonObject filter)
Finds all documents in the collection.MongoResult<TDocument>
find(ClientSession clientSession, JsonObject filter, FindOptions options)
Finds all documents in the collection.MongoResult<TDocument>
find(ClientSession clientSession, FindOptions options)
Finds all documents in the collection.MongoResult<TDocument>
find(FindOptions options)
Finds all documents in the collection.Future<TDocument>
findOneAndDelete(JsonObject filter)
Atomically find a document and remove it.void
findOneAndDelete(JsonObject filter, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and remove it.Future<TDocument>
findOneAndDelete(JsonObject filter, FindOneAndDeleteOptions options)
Atomically find a document and remove it.void
findOneAndDelete(JsonObject filter, FindOneAndDeleteOptions options, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and remove it.Future<TDocument>
findOneAndDelete(ClientSession clientSession, JsonObject filter)
Atomically find a document and remove it.void
findOneAndDelete(ClientSession clientSession, JsonObject filter, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and remove it.Future<TDocument>
findOneAndDelete(ClientSession clientSession, JsonObject filter, FindOneAndDeleteOptions options)
Atomically find a document and remove it.void
findOneAndDelete(ClientSession clientSession, JsonObject filter, FindOneAndDeleteOptions options, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and remove it.Future<TDocument>
findOneAndReplace(JsonObject filter, TDocument replacement)
Atomically find a document and replace it.void
findOneAndReplace(JsonObject filter, TDocument replacement, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and replace it.Future<TDocument>
findOneAndReplace(JsonObject filter, TDocument replacement, FindOneAndReplaceOptions options)
Atomically find a document and replace it.void
findOneAndReplace(JsonObject filter, TDocument replacement, FindOneAndReplaceOptions options, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and replace it.Future<TDocument>
findOneAndReplace(ClientSession clientSession, JsonObject filter, TDocument replacement)
Atomically find a document and replace it.void
findOneAndReplace(ClientSession clientSession, JsonObject filter, TDocument replacement, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and replace it.Future<TDocument>
findOneAndReplace(ClientSession clientSession, JsonObject filter, TDocument replacement, FindOneAndReplaceOptions options)
Atomically find a document and replace it.void
findOneAndReplace(ClientSession clientSession, JsonObject filter, TDocument replacement, FindOneAndReplaceOptions options, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and replace it.Future<TDocument>
findOneAndUpdate(JsonObject filter, JsonArray update)
Atomically find a document and update it.void
findOneAndUpdate(JsonObject filter, JsonArray update, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and update it.Future<TDocument>
findOneAndUpdate(JsonObject filter, JsonArray update, FindOneAndUpdateOptions options)
Atomically find a document and update it.void
findOneAndUpdate(JsonObject filter, JsonArray update, FindOneAndUpdateOptions options, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and update it.Future<TDocument>
findOneAndUpdate(JsonObject filter, JsonObject update)
Atomically find a document and update it.void
findOneAndUpdate(JsonObject filter, JsonObject update, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and update it.Future<TDocument>
findOneAndUpdate(JsonObject filter, JsonObject update, FindOneAndUpdateOptions options)
Atomically find a document and update it.void
findOneAndUpdate(JsonObject filter, JsonObject update, FindOneAndUpdateOptions options, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and update it.Future<TDocument>
findOneAndUpdate(ClientSession clientSession, JsonObject filter, JsonArray update)
Atomically find a document and update it.void
findOneAndUpdate(ClientSession clientSession, JsonObject filter, JsonArray update, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and update it.Future<TDocument>
findOneAndUpdate(ClientSession clientSession, JsonObject filter, JsonArray update, FindOneAndUpdateOptions options)
Atomically find a document and update it.void
findOneAndUpdate(ClientSession clientSession, JsonObject filter, JsonArray update, FindOneAndUpdateOptions options, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and update it.Future<TDocument>
findOneAndUpdate(ClientSession clientSession, JsonObject filter, JsonObject update)
Atomically find a document and update it.void
findOneAndUpdate(ClientSession clientSession, JsonObject filter, JsonObject update, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and update it.Future<TDocument>
findOneAndUpdate(ClientSession clientSession, JsonObject filter, JsonObject update, FindOneAndUpdateOptions options)
Atomically find a document and update it.void
findOneAndUpdate(ClientSession clientSession, JsonObject filter, JsonObject update, FindOneAndUpdateOptions options, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and update it.CodecRegistry
getCodecRegistry()
Get the codec registry for the MongoCollection.java.lang.Class<TDocument>
getDocumentClass()
Get the class of documents stored in this collection.MongoNamespace
getNamespace()
Gets the namespace of this collection.ReadConcern
getReadConcern()
Get the read concern for the MongoCollection.ReadPreference
getReadPreference()
Get the read preference for the MongoCollection.WriteConcern
getWriteConcern()
Get the write concern for the MongoCollection.Future<InsertManyResult>
insertMany(ClientSession clientSession, java.util.List<? extends TDocument> documents)
Inserts a batch of documents.void
insertMany(ClientSession clientSession, java.util.List<? extends TDocument> documents, Handler<AsyncResult<InsertManyResult>> resultHandler)
Inserts a batch of documents.Future<InsertManyResult>
insertMany(ClientSession clientSession, java.util.List<? extends TDocument> documents, InsertManyOptions options)
Inserts a batch of documents.void
insertMany(ClientSession clientSession, java.util.List<? extends TDocument> documents, InsertManyOptions options, Handler<AsyncResult<InsertManyResult>> resultHandler)
Inserts a batch of documents.Future<InsertManyResult>
insertMany(java.util.List<? extends TDocument> documents)
Inserts a batch of documents.void
insertMany(java.util.List<? extends TDocument> documents, Handler<AsyncResult<InsertManyResult>> resultHandler)
Inserts a batch of documents.Future<InsertManyResult>
insertMany(java.util.List<? extends TDocument> documents, InsertManyOptions options)
Inserts a batch of documents.void
insertMany(java.util.List<? extends TDocument> documents, InsertManyOptions options, Handler<AsyncResult<InsertManyResult>> resultHandler)
Inserts a batch of documents.Future<InsertOneResult>
insertOne(ClientSession clientSession, TDocument document)
Inserts the provided document.void
insertOne(ClientSession clientSession, TDocument document, Handler<AsyncResult<InsertOneResult>> resultHandler)
Inserts the provided document.Future<InsertOneResult>
insertOne(ClientSession clientSession, TDocument document, InsertOneOptions options)
Inserts the provided document.void
insertOne(ClientSession clientSession, TDocument document, InsertOneOptions options, Handler<AsyncResult<InsertOneResult>> resultHandler)
Inserts the provided document.Future<InsertOneResult>
insertOne(TDocument document)
Inserts the provided document.void
insertOne(TDocument document, Handler<AsyncResult<InsertOneResult>> resultHandler)
Inserts the provided document.Future<InsertOneResult>
insertOne(TDocument document, InsertOneOptions options)
Inserts the provided document.void
insertOne(TDocument document, InsertOneOptions options, Handler<AsyncResult<InsertOneResult>> resultHandler)
Inserts the provided document.MongoResult<JsonObject>
listIndexes()
Get all the indexes in this collection.MongoResult<JsonObject>
listIndexes(ClientSession clientSession)
Get all the indexes in this collection.MongoResult<JsonObject>
listIndexes(ClientSession clientSession, ListIndexesOptions options)
Get all the indexes in this collection.MongoResult<JsonObject>
listIndexes(ListIndexesOptions options)
Get all the indexes in this collection.MongoCollectionResult<TDocument>
mapReduce(ClientSession clientSession, java.lang.String mapFunction, java.lang.String reduceFunction)
Aggregates documents according to the specified map-reduce function.MongoCollectionResult<TDocument>
mapReduce(ClientSession clientSession, java.lang.String mapFunction, java.lang.String reduceFunction, MapReduceOptions options)
Aggregates documents according to the specified map-reduce function.MongoCollectionResult<TDocument>
mapReduce(java.lang.String mapFunction, java.lang.String reduceFunction)
Aggregates documents according to the specified map-reduce function.MongoCollectionResult<TDocument>
mapReduce(java.lang.String mapFunction, java.lang.String reduceFunction, MapReduceOptions options)
Aggregates documents according to the specified map-reduce function.Future<java.lang.Void>
renameCollection(MongoNamespace newCollectionNamespace)
Rename the collection with oldCollectionName to the newCollectionName.void
renameCollection(MongoNamespace newCollectionNamespace, Handler<AsyncResult<java.lang.Void>> resultHandler)
Rename the collection with oldCollectionName to the newCollectionName.Future<java.lang.Void>
renameCollection(MongoNamespace newCollectionNamespace, RenameCollectionOptions options)
Rename the collection with oldCollectionName to the newCollectionName.void
renameCollection(MongoNamespace newCollectionNamespace, RenameCollectionOptions options, Handler<AsyncResult<java.lang.Void>> resultHandler)
Rename the collection with oldCollectionName to the newCollectionName.Future<java.lang.Void>
renameCollection(ClientSession clientSession, MongoNamespace newCollectionNamespace)
Rename the collection with oldCollectionName to the newCollectionName.void
renameCollection(ClientSession clientSession, MongoNamespace newCollectionNamespace, Handler<AsyncResult<java.lang.Void>> resultHandler)
Rename the collection with oldCollectionName to the newCollectionName.Future<java.lang.Void>
renameCollection(ClientSession clientSession, MongoNamespace newCollectionNamespace, RenameCollectionOptions options)
Rename the collection with oldCollectionName to the newCollectionName.void
renameCollection(ClientSession clientSession, MongoNamespace newCollectionNamespace, RenameCollectionOptions options, Handler<AsyncResult<java.lang.Void>> resultHandler)
Rename the collection with oldCollectionName to the newCollectionName.Future<UpdateResult>
replaceOne(JsonObject filter, TDocument replacement)
Replace a document in the collection according to the specified arguments.void
replaceOne(JsonObject filter, TDocument replacement, Handler<AsyncResult<UpdateResult>> resultHandler)
Replace a document in the collection according to the specified arguments.Future<UpdateResult>
replaceOne(JsonObject filter, TDocument replacement, ReplaceOptions options)
Replace a document in the collection according to the specified arguments.void
replaceOne(JsonObject filter, TDocument replacement, ReplaceOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Replace a document in the collection according to the specified arguments.Future<UpdateResult>
replaceOne(ClientSession clientSession, JsonObject filter, TDocument replacement)
Replace a document in the collection according to the specified arguments.void
replaceOne(ClientSession clientSession, JsonObject filter, TDocument replacement, Handler<AsyncResult<UpdateResult>> resultHandler)
Replace a document in the collection according to the specified arguments.Future<UpdateResult>
replaceOne(ClientSession clientSession, JsonObject filter, TDocument replacement, ReplaceOptions options)
Replace a document in the collection according to the specified arguments.void
replaceOne(ClientSession clientSession, JsonObject filter, TDocument replacement, ReplaceOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Replace a document in the collection according to the specified arguments.Future<UpdateResult>
replaceOne(ClientSession clientSession, TDocument replacement)
Replace a document in the collection according to the specified arguments.void
replaceOne(ClientSession clientSession, TDocument replacement, Handler<AsyncResult<UpdateResult>> resultHandler)
Replace a document in the collection according to the specified arguments.Future<UpdateResult>
replaceOne(ClientSession clientSession, TDocument replacement, ReplaceOptions options)
Replace a document in the collection according to the specified arguments.void
replaceOne(ClientSession clientSession, TDocument replacement, ReplaceOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Replace a document in the collection according to the specified arguments.Future<UpdateResult>
replaceOne(TDocument replacement)
Replace a document in the collection according to the specified arguments.void
replaceOne(TDocument replacement, Handler<AsyncResult<UpdateResult>> resultHandler)
Replace a document in the collection according to the specified arguments.Future<UpdateResult>
replaceOne(TDocument replacement, ReplaceOptions options)
Replace a document in the collection according to the specified arguments.void
replaceOne(TDocument replacement, ReplaceOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Replace a document in the collection according to the specified arguments.Future<UpdateResult>
updateMany(JsonObject filter, JsonArray update)
Update all documents in the collection according to the specified arguments.void
updateMany(JsonObject filter, JsonArray update, Handler<AsyncResult<UpdateResult>> resultHandler)
Update all documents in the collection according to the specified arguments.Future<UpdateResult>
updateMany(JsonObject filter, JsonArray update, UpdateOptions options)
Update all documents in the collection according to the specified arguments.void
updateMany(JsonObject filter, JsonArray update, UpdateOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Update all documents in the collection according to the specified arguments.Future<UpdateResult>
updateMany(JsonObject filter, JsonObject update)
Update all documents in the collection according to the specified arguments.void
updateMany(JsonObject filter, JsonObject update, Handler<AsyncResult<UpdateResult>> resultHandler)
Update all documents in the collection according to the specified arguments.Future<UpdateResult>
updateMany(JsonObject filter, JsonObject update, UpdateOptions options)
Update all documents in the collection according to the specified arguments.void
updateMany(JsonObject filter, JsonObject update, UpdateOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Update all documents in the collection according to the specified arguments.Future<UpdateResult>
updateMany(ClientSession clientSession, JsonObject filter, JsonArray update)
Update all documents in the collection according to the specified arguments.void
updateMany(ClientSession clientSession, JsonObject filter, JsonArray update, Handler<AsyncResult<UpdateResult>> resultHandler)
Update all documents in the collection according to the specified arguments.Future<UpdateResult>
updateMany(ClientSession clientSession, JsonObject filter, JsonArray update, UpdateOptions options)
Update all documents in the collection according to the specified arguments.void
updateMany(ClientSession clientSession, JsonObject filter, JsonArray update, UpdateOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Update all documents in the collection according to the specified arguments.Future<UpdateResult>
updateMany(ClientSession clientSession, JsonObject filter, JsonObject update)
Update all documents in the collection according to the specified arguments.void
updateMany(ClientSession clientSession, JsonObject filter, JsonObject update, Handler<AsyncResult<UpdateResult>> resultHandler)
Update all documents in the collection according to the specified arguments.Future<UpdateResult>
updateMany(ClientSession clientSession, JsonObject filter, JsonObject update, UpdateOptions options)
Update all documents in the collection according to the specified arguments.void
updateMany(ClientSession clientSession, JsonObject filter, JsonObject update, UpdateOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Update all documents in the collection according to the specified arguments.Future<UpdateResult>
updateOne(JsonObject filter, JsonArray update)
Update a single document in the collection according to the specified arguments.void
updateOne(JsonObject filter, JsonArray update, Handler<AsyncResult<UpdateResult>> resultHandler)
Update a single document in the collection according to the specified arguments.Future<UpdateResult>
updateOne(JsonObject filter, JsonArray update, UpdateOptions options)
Update a single document in the collection according to the specified arguments.void
updateOne(JsonObject filter, JsonArray update, UpdateOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Update a single document in the collection according to the specified arguments.Future<UpdateResult>
updateOne(JsonObject filter, JsonObject update)
Update a single document in the collection according to the specified arguments.void
updateOne(JsonObject filter, JsonObject update, Handler<AsyncResult<UpdateResult>> resultHandler)
Update a single document in the collection according to the specified arguments.Future<UpdateResult>
updateOne(JsonObject filter, JsonObject update, UpdateOptions options)
Update a single document in the collection according to the specified arguments.void
updateOne(JsonObject filter, JsonObject update, UpdateOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Update a single document in the collection according to the specified arguments.Future<UpdateResult>
updateOne(ClientSession clientSession, JsonObject filter, JsonArray update)
Update a single document in the collection according to the specified arguments.void
updateOne(ClientSession clientSession, JsonObject filter, JsonArray update, Handler<AsyncResult<UpdateResult>> resultHandler)
Update a single document in the collection according to the specified arguments.Future<UpdateResult>
updateOne(ClientSession clientSession, JsonObject filter, JsonArray update, UpdateOptions options)
Update a single document in the collection according to the specified arguments.void
updateOne(ClientSession clientSession, JsonObject filter, JsonArray update, UpdateOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Update a single document in the collection according to the specified arguments.Future<UpdateResult>
updateOne(ClientSession clientSession, JsonObject filter, JsonObject update)
Update a single document in the collection according to the specified arguments.void
updateOne(ClientSession clientSession, JsonObject filter, JsonObject update, Handler<AsyncResult<UpdateResult>> resultHandler)
Update a single document in the collection according to the specified arguments.Future<UpdateResult>
updateOne(ClientSession clientSession, JsonObject filter, JsonObject update, UpdateOptions options)
Update a single document in the collection according to the specified arguments.void
updateOne(ClientSession clientSession, JsonObject filter, JsonObject update, UpdateOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Update a single document in the collection according to the specified arguments.MongoResult<ChangeStreamDocument<JsonObject>>
watch()
Creates a change stream for this collection.MongoResult<ChangeStreamDocument<JsonObject>>
watch(JsonArray pipeline)
Creates a change stream for this collection.MongoResult<ChangeStreamDocument<JsonObject>>
watch(JsonArray pipeline, ChangeStreamOptions options)
Creates a change stream for this collection.MongoResult<ChangeStreamDocument<JsonObject>>
watch(ChangeStreamOptions options)
Creates a change stream for this collection.MongoResult<ChangeStreamDocument<JsonObject>>
watch(ClientSession clientSession)
Creates a change stream for this collection.MongoResult<ChangeStreamDocument<JsonObject>>
watch(ClientSession clientSession, JsonArray pipeline)
Creates a change stream for this collection.MongoResult<ChangeStreamDocument<JsonObject>>
watch(ClientSession clientSession, JsonArray pipeline, ChangeStreamOptions options)
Creates a change stream for this collection.MongoResult<ChangeStreamDocument<JsonObject>>
watch(ClientSession clientSession, ChangeStreamOptions options)
Creates a change stream for this collection.MongoCollection<TDocument>
withCodecRegistry(CodecRegistry codecRegistry)
Create a new MongoCollection instance with a different codec registry.<NewTDocument>
MongoCollection<NewTDocument>withDocumentClass(java.lang.Class<NewTDocument> clazz)
Create a new MongoCollection instance with a different default class to cast any documents returned from the database into..MongoCollection<TDocument>
withReadConcern(ReadConcern readConcern)
Create a new MongoCollection instance with a different read concern.MongoCollection<TDocument>
withReadPreference(ReadPreference readPreference)
Create a new MongoCollection instance with a different read preference.MongoCollection<TDocument>
withWriteConcern(WriteConcern writeConcern)
Create a new MongoCollection instance with a different write concern.
-
-
-
Method Detail
-
getNamespace
MongoNamespace getNamespace()
Gets the namespace of this collection.- Returns:
- the namespace
-
getDocumentClass
java.lang.Class<TDocument> getDocumentClass()
Get the class of documents stored in this collection.- Returns:
- the class
-
getCodecRegistry
CodecRegistry getCodecRegistry()
Get the codec registry for the MongoCollection.- Returns:
- the
CodecRegistry
-
getReadPreference
ReadPreference getReadPreference()
Get the read preference for the MongoCollection.- Returns:
- the
ReadPreference
-
getWriteConcern
WriteConcern getWriteConcern()
Get the write concern for the MongoCollection.- Returns:
- the
WriteConcern
-
getReadConcern
ReadConcern getReadConcern()
Get the read concern for the MongoCollection.- Returns:
- the
ReadConcern
- Since:
- 1.2
- Since server release
- 3.2
-
withDocumentClass
<NewTDocument> MongoCollection<NewTDocument> withDocumentClass(java.lang.Class<NewTDocument> clazz)
Create a new MongoCollection instance with a different default class to cast any documents returned from the database into..- Type Parameters:
NewTDocument
- The type that the new collection will encode documents from and decode documents to- Parameters:
clazz
- the default class to cast any documents returned from the database into.- Returns:
- a new MongoCollection instance with the different default class
-
withCodecRegistry
MongoCollection<TDocument> withCodecRegistry(CodecRegistry codecRegistry)
Create a new MongoCollection instance with a different codec registry.- Parameters:
codecRegistry
- the newCodecRegistry
for the collection- Returns:
- a new MongoCollection instance with the different codec registry
-
withReadPreference
MongoCollection<TDocument> withReadPreference(ReadPreference readPreference)
Create a new MongoCollection instance with a different read preference.- Parameters:
readPreference
- the newReadPreference
for the collection- Returns:
- a new MongoCollection instance with the different readPreference
-
withWriteConcern
MongoCollection<TDocument> withWriteConcern(WriteConcern writeConcern)
Create a new MongoCollection instance with a different write concern.- Parameters:
writeConcern
- the newWriteConcern
for the collection- Returns:
- a new MongoCollection instance with the different writeConcern
-
withReadConcern
MongoCollection<TDocument> withReadConcern(ReadConcern readConcern)
Create a new MongoCollection instance with a different read concern.- Parameters:
readConcern
- the newReadConcern
for the collection- Returns:
- a new MongoCollection instance with the different ReadConcern
- Since:
- 1.2
- Since server release
- 3.2
-
estimatedDocumentCount
Future<java.lang.Long> estimatedDocumentCount()
Gets an estimate of the count of documents in a collection using collection metadata.- Returns:
- a future with a single element indicating the estimated number of documents
- Since:
- 1.9
-
estimatedDocumentCount
void estimatedDocumentCount(Handler<AsyncResult<java.lang.Long>> resultHandler)
Gets an estimate of the count of documents in a collection using collection metadata.- Parameters:
resultHandler
- an async result with a single element indicating the estimated number of documents- Since:
- 1.9
-
estimatedDocumentCount
Future<java.lang.Long> estimatedDocumentCount(EstimatedDocumentCountOptions options)
Gets an estimate of the count of documents in a collection using collection metadata.- Parameters:
options
- the options describing the count- Returns:
- a future with a single element indicating the estimated number of documents
- Since:
- 1.9
-
estimatedDocumentCount
void estimatedDocumentCount(EstimatedDocumentCountOptions options, Handler<AsyncResult<java.lang.Long>> resultHandler)
Gets an estimate of the count of documents in a collection using collection metadata.- Parameters:
options
- the options describing the countresultHandler
- an async result with a single element indicating the estimated number of documents- Since:
- 1.9
-
countDocuments
Future<java.lang.Long> countDocuments()
Counts the number of documents in the collection.Note: For a fast count of the total documents in a collection see
estimatedDocumentCount()
.
Note: When migrating fromcount()
tocountDocuments()
the following query operators must be replaced:+-------------+--------------------------------+ | Operator | Replacement | +=============+================================+ | $where | $expr | +-------------+--------------------------------+ | $near | $geoWithin with $center | +-------------+--------------------------------+ | $nearSphere | $geoWithin with $centerSphere | +-------------+--------------------------------+
- Returns:
- a future with a single element indicating the number of documents
- Since:
- 1.9
-
countDocuments
void countDocuments(Handler<AsyncResult<java.lang.Long>> resultHandler)
Counts the number of documents in the collection.Note: For a fast count of the total documents in a collection see
estimatedDocumentCount()
.
Note: When migrating fromcount()
tocountDocuments()
the following query operators must be replaced:+-------------+--------------------------------+ | Operator | Replacement | +=============+================================+ | $where | $expr | +-------------+--------------------------------+ | $near | $geoWithin with $center | +-------------+--------------------------------+ | $nearSphere | $geoWithin with $centerSphere | +-------------+--------------------------------+
- Parameters:
resultHandler
- an async result with a single element indicating the number of documents- Since:
- 1.9
-
countDocuments
Future<java.lang.Long> countDocuments(JsonObject filter)
Counts the number of documents in the collection according to the given options.Note: For a fast count of the total documents in a collection see
estimatedDocumentCount()
.
Note: When migrating fromcount()
tocountDocuments()
the following query operators must be replaced:+-------------+--------------------------------+ | Operator | Replacement | +=============+================================+ | $where | $expr | +-------------+--------------------------------+ | $near | $geoWithin with $center | +-------------+--------------------------------+ | $nearSphere | $geoWithin with $centerSphere | +-------------+--------------------------------+
- Parameters:
filter
- the query filter- Returns:
- a future with a single element indicating the number of documents
- Since:
- 1.9
-
countDocuments
void countDocuments(JsonObject filter, Handler<AsyncResult<java.lang.Long>> resultHandler)
Counts the number of documents in the collection according to the given options.Note: For a fast count of the total documents in a collection see
estimatedDocumentCount()
.
Note: When migrating fromcount()
tocountDocuments()
the following query operators must be replaced:+-------------+--------------------------------+ | Operator | Replacement | +=============+================================+ | $where | $expr | +-------------+--------------------------------+ | $near | $geoWithin with $center | +-------------+--------------------------------+ | $nearSphere | $geoWithin with $centerSphere | +-------------+--------------------------------+
- Parameters:
filter
- the query filterresultHandler
- an async result with a single element indicating the number of documents- Since:
- 1.9
-
countDocuments
Future<java.lang.Long> countDocuments(JsonObject filter, CountOptions options)
Counts the number of documents in the collection according to the given options.Note: For a fast count of the total documents in a collection see
estimatedDocumentCount()
.
Note: When migrating fromcount()
tocountDocuments()
the following query operators must be replaced:+-------------+--------------------------------+ | Operator | Replacement | +=============+================================+ | $where | $expr | +-------------+--------------------------------+ | $near | $geoWithin with $center | +-------------+--------------------------------+ | $nearSphere | $geoWithin with $centerSphere | +-------------+--------------------------------+
- Parameters:
filter
- the query filteroptions
- the options describing the count- Returns:
- a future with a single element indicating the number of documents
- Since:
- 1.9
-
countDocuments
void countDocuments(JsonObject filter, CountOptions options, Handler<AsyncResult<java.lang.Long>> resultHandler)
Counts the number of documents in the collection according to the given options.Note: For a fast count of the total documents in a collection see
estimatedDocumentCount()
.
Note: When migrating fromcount()
tocountDocuments()
the following query operators must be replaced:+-------------+--------------------------------+ | Operator | Replacement | +=============+================================+ | $where | $expr | +-------------+--------------------------------+ | $near | $geoWithin with $center | +-------------+--------------------------------+ | $nearSphere | $geoWithin with $centerSphere | +-------------+--------------------------------+
- Parameters:
filter
- the query filteroptions
- the options describing the countresultHandler
- an async result with a single element indicating the number of documents- Since:
- 1.9
-
countDocuments
Future<java.lang.Long> countDocuments(ClientSession clientSession)
Counts the number of documents in the collection.Note: For a fast count of the total documents in a collection see
estimatedDocumentCount()
.
Note: When migrating fromcount()
tocountDocuments()
the following query operators must be replaced:+-------------+--------------------------------+ | Operator | Replacement | +=============+================================+ | $where | $expr | +-------------+--------------------------------+ | $near | $geoWithin with $center | +-------------+--------------------------------+ | $nearSphere | $geoWithin with $centerSphere | +-------------+--------------------------------+
- Parameters:
clientSession
- the client session with which to associate this operation- Returns:
- a future with a single element indicating the number of documents
- Since:
- 1.9
- Since server release
- 3.6
-
countDocuments
void countDocuments(ClientSession clientSession, Handler<AsyncResult<java.lang.Long>> resultHandler)
Counts the number of documents in the collection.Note: For a fast count of the total documents in a collection see
estimatedDocumentCount()
.
Note: When migrating fromcount()
tocountDocuments()
the following query operators must be replaced:+-------------+--------------------------------+ | Operator | Replacement | +=============+================================+ | $where | $expr | +-------------+--------------------------------+ | $near | $geoWithin with $center | +-------------+--------------------------------+ | $nearSphere | $geoWithin with $centerSphere | +-------------+--------------------------------+
- Parameters:
clientSession
- the client session with which to associate this operationresultHandler
- an async result with a single element indicating the number of documents- Since:
- 1.9
- Since server release
- 3.6
-
countDocuments
Future<java.lang.Long> countDocuments(ClientSession clientSession, JsonObject filter)
Counts the number of documents in the collection according to the given options.Note: For a fast count of the total documents in a collection see
estimatedDocumentCount()
.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filter- Returns:
- a future with a single element indicating the number of documents
- Since:
- 1.9
- Since server release
- 3.6
-
countDocuments
void countDocuments(ClientSession clientSession, JsonObject filter, Handler<AsyncResult<java.lang.Long>> resultHandler)
Counts the number of documents in the collection according to the given options.Note: For a fast count of the total documents in a collection see
estimatedDocumentCount()
.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filterresultHandler
- an async result with a single element indicating the number of documents- Since:
- 1.9
- Since server release
- 3.6
-
countDocuments
Future<java.lang.Long> countDocuments(ClientSession clientSession, JsonObject filter, CountOptions options)
Counts the number of documents in the collection according to the given options.Note: For a fast count of the total documents in a collection see
estimatedDocumentCount()
.
Note: When migrating fromcount()
tocountDocuments()
the following query operators must be replaced:+-------------+--------------------------------+ | Operator | Replacement | +=============+================================+ | $where | $expr | +-------------+--------------------------------+ | $near | $geoWithin with $center | +-------------+--------------------------------+ | $nearSphere | $geoWithin with $centerSphere | +-------------+--------------------------------+
- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filteroptions
- the options describing the count- Returns:
- a future with a single element indicating the number of documents
- Since:
- 1.9
- Since server release
- 3.6
-
countDocuments
void countDocuments(ClientSession clientSession, JsonObject filter, CountOptions options, Handler<AsyncResult<java.lang.Long>> resultHandler)
Counts the number of documents in the collection according to the given options.Note: For a fast count of the total documents in a collection see
estimatedDocumentCount()
.
Note: When migrating fromcount()
tocountDocuments()
the following query operators must be replaced:+-------------+--------------------------------+ | Operator | Replacement | +=============+================================+ | $where | $expr | +-------------+--------------------------------+ | $near | $geoWithin with $center | +-------------+--------------------------------+ | $nearSphere | $geoWithin with $centerSphere | +-------------+--------------------------------+
- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filteroptions
- the options describing the countresultHandler
- an async result with a single element indicating the number of documents- Since:
- 1.9
- Since server release
- 3.6
-
find
MongoResult<TDocument> find()
Finds all documents in the collection.- Returns:
- the fluent find interface
- MongoDB documentation
- Find
-
find
MongoResult<TDocument> find(FindOptions options)
Finds all documents in the collection.- Parameters:
options
- options- Returns:
- the fluent find interface
- MongoDB documentation
- Find
-
find
MongoResult<TDocument> find(JsonObject filter)
Finds all documents in the collection.- Parameters:
filter
- the query filter- Returns:
- the fluent find interface
- MongoDB documentation
- Find
-
find
MongoResult<TDocument> find(JsonObject filter, FindOptions options)
Finds all documents in the collection.- Parameters:
filter
- the query filteroptions
- options- Returns:
- the fluent find interface
- MongoDB documentation
- Find
-
find
MongoResult<TDocument> find(ClientSession clientSession)
Finds all documents in the collection.
-
find
MongoResult<TDocument> find(ClientSession clientSession, FindOptions options)
Finds all documents in the collection.
-
find
MongoResult<TDocument> find(ClientSession clientSession, JsonObject filter)
Finds all documents in the collection.
-
find
MongoResult<TDocument> find(ClientSession clientSession, JsonObject filter, FindOptions options)
Finds all documents in the collection.
-
aggregate
MongoCollectionResult<TDocument> aggregate(JsonArray pipeline)
Aggregates documents according to the specified aggregation pipeline.- Parameters:
pipeline
- the aggregate pipeline- Returns:
- a result containing the result of the aggregation operation
- MongoDB documentation
- Aggregation
-
aggregate
MongoCollectionResult<TDocument> aggregate(JsonArray pipeline, AggregateOptions options)
Aggregates documents according to the specified aggregation pipeline.- Parameters:
pipeline
- the aggregate pipelineoptions
- options- Returns:
- a result containing the result of the aggregation operation
- MongoDB documentation
- Aggregation
-
aggregate
MongoCollectionResult<TDocument> aggregate(ClientSession clientSession, JsonArray pipeline)
Aggregates documents according to the specified aggregation pipeline.- Parameters:
clientSession
- the client session with which to associate this operationpipeline
- the aggregate pipeline- Returns:
- a result containing the result of the aggregation operation
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Aggregation
-
aggregate
MongoCollectionResult<TDocument> aggregate(ClientSession clientSession, JsonArray pipeline, AggregateOptions options)
Aggregates documents according to the specified aggregation pipeline.- Parameters:
clientSession
- the client session with which to associate this operationpipeline
- the aggregate pipelineoptions
- options- Returns:
- a result containing the result of the aggregation operation
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Aggregation
-
watch
MongoResult<ChangeStreamDocument<JsonObject>> watch()
Creates a change stream for this collection.- Returns:
- the change stream read stream
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- $changeStream
-
watch
MongoResult<ChangeStreamDocument<JsonObject>> watch(ChangeStreamOptions options)
Creates a change stream for this collection.- Parameters:
options
- options- Returns:
- the change stream read stream
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- $changeStream
-
watch
MongoResult<ChangeStreamDocument<JsonObject>> watch(JsonArray pipeline)
Creates a change stream for this collection.- Parameters:
pipeline
- the aggregation pipeline to apply to the change stream- Returns:
- the change stream read stream
- Since:
- 1.6
- MongoDB documentation
- $changeStream
-
watch
MongoResult<ChangeStreamDocument<JsonObject>> watch(JsonArray pipeline, ChangeStreamOptions options)
Creates a change stream for this collection.- Parameters:
pipeline
- the aggregation pipeline to apply to the change streamoptions
- options- Returns:
- the change stream read stream
- Since:
- 1.6
- MongoDB documentation
- $changeStream
-
watch
MongoResult<ChangeStreamDocument<JsonObject>> watch(ClientSession clientSession)
Creates a change stream for this collection.- Parameters:
clientSession
- the client session with which to associate this operation- Returns:
- the change stream read stream
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- $changeStream
-
watch
MongoResult<ChangeStreamDocument<JsonObject>> watch(ClientSession clientSession, ChangeStreamOptions options)
Creates a change stream for this collection.- Parameters:
clientSession
- the client session with which to associate this operationoptions
- options- Returns:
- the change stream read stream
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- $changeStream
-
watch
MongoResult<ChangeStreamDocument<JsonObject>> watch(ClientSession clientSession, JsonArray pipeline)
Creates a change stream for this collection.- Parameters:
clientSession
- the client session with which to associate this operationpipeline
- the aggregation pipeline to apply to the change stream- Returns:
- the change stream read stream
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- $changeStream
-
watch
MongoResult<ChangeStreamDocument<JsonObject>> watch(ClientSession clientSession, JsonArray pipeline, ChangeStreamOptions options)
Creates a change stream for this collection.- Parameters:
clientSession
- the client session with which to associate this operationpipeline
- the aggregation pipeline to apply to the change streamoptions
- options- Returns:
- the change stream read stream
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- $changeStream
-
mapReduce
MongoCollectionResult<TDocument> mapReduce(java.lang.String mapFunction, java.lang.String reduceFunction)
Aggregates documents according to the specified map-reduce function.- Parameters:
mapFunction
- A JavaScript function that associates or "maps" a value with a key and emits the key and value pair.reduceFunction
- A JavaScript function that "reduces" to a single object all the values associated with a particular key.- Returns:
- an result containing the result of the map-reduce operation
- MongoDB documentation
- map-reduce
-
mapReduce
MongoCollectionResult<TDocument> mapReduce(java.lang.String mapFunction, java.lang.String reduceFunction, MapReduceOptions options)
Aggregates documents according to the specified map-reduce function.- Parameters:
mapFunction
- A JavaScript function that associates or "maps" a value with a key and emits the key and value pair.reduceFunction
- A JavaScript function that "reduces" to a single object all the values associated with a particular key.options
- options- Returns:
- an result containing the result of the map-reduce operation
- MongoDB documentation
- map-reduce
-
mapReduce
MongoCollectionResult<TDocument> mapReduce(ClientSession clientSession, java.lang.String mapFunction, java.lang.String reduceFunction)
Aggregates documents according to the specified map-reduce function.- Parameters:
clientSession
- the client session with which to associate this operationmapFunction
- A JavaScript function that associates or "maps" a value with a key and emits the key and value pair.reduceFunction
- A JavaScript function that "reduces" to a single object all the values associated with a particular key.- Returns:
- an result containing the result of the map-reduce operation
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- map-reduce
-
mapReduce
MongoCollectionResult<TDocument> mapReduce(ClientSession clientSession, java.lang.String mapFunction, java.lang.String reduceFunction, MapReduceOptions options)
Aggregates documents according to the specified map-reduce function.- Parameters:
clientSession
- the client session with which to associate this operationmapFunction
- A JavaScript function that associates or "maps" a value with a key and emits the key and value pair.reduceFunction
- A JavaScript function that "reduces" to a single object all the values associated with a particular key.options
- options- Returns:
- an result containing the result of the map-reduce operation
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- map-reduce
-
bulkWrite
Future<BulkWriteResult> bulkWrite(java.util.List<? extends WriteModel<? extends TDocument>> requests)
Executes a mix of inserts, updates, replaces, and deletes.- Parameters:
requests
- the writes to execute- Returns:
- a future with a single element the BulkWriteResult
-
bulkWrite
void bulkWrite(java.util.List<? extends WriteModel<? extends TDocument>> requests, Handler<AsyncResult<BulkWriteResult>> resultHandler)
Executes a mix of inserts, updates, replaces, and deletes.- Parameters:
requests
- the writes to executeresultHandler
- an async result with a single element the BulkWriteResult
-
bulkWrite
Future<BulkWriteResult> bulkWrite(java.util.List<? extends WriteModel<? extends TDocument>> requests, BulkWriteOptions options)
Executes a mix of inserts, updates, replaces, and deletes.- Parameters:
requests
- the writes to executeoptions
- the options to apply to the bulk write operation- Returns:
- a future with a single element the BulkWriteResult
-
bulkWrite
void bulkWrite(java.util.List<? extends WriteModel<? extends TDocument>> requests, BulkWriteOptions options, Handler<AsyncResult<BulkWriteResult>> resultHandler)
Executes a mix of inserts, updates, replaces, and deletes.- Parameters:
requests
- the writes to executeoptions
- the options to apply to the bulk write operationresultHandler
- an async result with a single element the BulkWriteResult
-
bulkWrite
Future<BulkWriteResult> bulkWrite(ClientSession clientSession, java.util.List<? extends WriteModel<? extends TDocument>> requests)
Executes a mix of inserts, updates, replaces, and deletes.- Parameters:
clientSession
- the client session with which to associate this operationrequests
- the writes to execute- Returns:
- a future with a single element the BulkWriteResult
- Since:
- 1.7
- Since server release
- 3.6
-
bulkWrite
void bulkWrite(ClientSession clientSession, java.util.List<? extends WriteModel<? extends TDocument>> requests, Handler<AsyncResult<BulkWriteResult>> resultHandler)
Executes a mix of inserts, updates, replaces, and deletes.- Parameters:
clientSession
- the client session with which to associate this operationrequests
- the writes to executeresultHandler
- an async result with a single element the BulkWriteResult- Since:
- 1.7
- Since server release
- 3.6
-
bulkWrite
Future<BulkWriteResult> bulkWrite(ClientSession clientSession, java.util.List<? extends WriteModel<? extends TDocument>> requests, BulkWriteOptions options)
Executes a mix of inserts, updates, replaces, and deletes.- Parameters:
clientSession
- the client session with which to associate this operationrequests
- the writes to executeoptions
- the options to apply to the bulk write operation- Returns:
- a future with a single element the BulkWriteResult
- Since:
- 1.7
- Since server release
- 3.6
-
bulkWrite
void bulkWrite(ClientSession clientSession, java.util.List<? extends WriteModel<? extends TDocument>> requests, BulkWriteOptions options, Handler<AsyncResult<BulkWriteResult>> resultHandler)
Executes a mix of inserts, updates, replaces, and deletes.- Parameters:
clientSession
- the client session with which to associate this operationrequests
- the writes to executeoptions
- the options to apply to the bulk write operationresultHandler
- an async result with a single element the BulkWriteResult- Since:
- 1.7
- Since server release
- 3.6
-
insertOne
Future<InsertOneResult> insertOne(TDocument document)
Inserts the provided document. If the document is missing an identifier, the driver should generate one.- Parameters:
document
- the document to insert- Returns:
- a future with a single element with the InsertOneResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException
-
insertOne
void insertOne(TDocument document, Handler<AsyncResult<InsertOneResult>> resultHandler)
Inserts the provided document. If the document is missing an identifier, the driver should generate one.- Parameters:
document
- the document to insertresultHandler
- an async result with a single element with the InsertOneResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException
-
insertOne
Future<InsertOneResult> insertOne(TDocument document, InsertOneOptions options)
Inserts the provided document. If the document is missing an identifier, the driver should generate one.- Parameters:
document
- the document to insertoptions
- the options to apply to the operation- Returns:
- a future with a single element with the InsertOneResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException
- Since:
- 1.2
-
insertOne
void insertOne(TDocument document, InsertOneOptions options, Handler<AsyncResult<InsertOneResult>> resultHandler)
Inserts the provided document. If the document is missing an identifier, the driver should generate one.- Parameters:
document
- the document to insertoptions
- the options to apply to the operationresultHandler
- an async result with a single element with the InsertOneResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException- Since:
- 1.2
-
insertOne
Future<InsertOneResult> insertOne(ClientSession clientSession, TDocument document)
Inserts the provided document. If the document is missing an identifier, the driver should generate one.- Parameters:
clientSession
- the client session with which to associate this operationdocument
- the document to insert- Returns:
- a future with a single element with the InsertOneResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException
- Since:
- 1.7
- Since server release
- 3.6
-
insertOne
void insertOne(ClientSession clientSession, TDocument document, Handler<AsyncResult<InsertOneResult>> resultHandler)
Inserts the provided document. If the document is missing an identifier, the driver should generate one.- Parameters:
clientSession
- the client session with which to associate this operationdocument
- the document to insertresultHandler
- an async result with a single element with the InsertOneResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException- Since:
- 1.7
- Since server release
- 3.6
-
insertOne
Future<InsertOneResult> insertOne(ClientSession clientSession, TDocument document, InsertOneOptions options)
Inserts the provided document. If the document is missing an identifier, the driver should generate one.- Parameters:
clientSession
- the client session with which to associate this operationdocument
- the document to insertoptions
- the options to apply to the operation- Returns:
- a future with a single element with the InsertOneResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException
- Since:
- 1.7
- Since server release
- 3.6
-
insertOne
void insertOne(ClientSession clientSession, TDocument document, InsertOneOptions options, Handler<AsyncResult<InsertOneResult>> resultHandler)
Inserts the provided document. If the document is missing an identifier, the driver should generate one.- Parameters:
clientSession
- the client session with which to associate this operationdocument
- the document to insertoptions
- the options to apply to the operationresultHandler
- an async result with a single element with the InsertOneResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException- Since:
- 1.7
- Since server release
- 3.6
-
insertMany
Future<InsertManyResult> insertMany(java.util.List<? extends TDocument> documents)
Inserts a batch of documents.- Parameters:
documents
- the documents to insert- Returns:
- a future with a single element with the InsertManyResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException
-
insertMany
void insertMany(java.util.List<? extends TDocument> documents, Handler<AsyncResult<InsertManyResult>> resultHandler)
Inserts a batch of documents.- Parameters:
documents
- the documents to insertresultHandler
- an async result with a single element with the InsertManyResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException
-
insertMany
Future<InsertManyResult> insertMany(java.util.List<? extends TDocument> documents, InsertManyOptions options)
Inserts a batch of documents.- Parameters:
documents
- the documents to insertoptions
- the options to apply to the operation- Returns:
- a future with a single element with the InsertManyResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException
-
insertMany
void insertMany(java.util.List<? extends TDocument> documents, InsertManyOptions options, Handler<AsyncResult<InsertManyResult>> resultHandler)
Inserts a batch of documents.- Parameters:
documents
- the documents to insertoptions
- the options to apply to the operationresultHandler
- an async result with a single element with the InsertManyResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException
-
insertMany
Future<InsertManyResult> insertMany(ClientSession clientSession, java.util.List<? extends TDocument> documents)
Inserts a batch of documents.- Parameters:
clientSession
- the client session with which to associate this operationdocuments
- the documents to insert- Returns:
- a future with a single element with the InsertManyResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException
- Since:
- 1.7
- Since server release
- 3.6
-
insertMany
void insertMany(ClientSession clientSession, java.util.List<? extends TDocument> documents, Handler<AsyncResult<InsertManyResult>> resultHandler)
Inserts a batch of documents.- Parameters:
clientSession
- the client session with which to associate this operationdocuments
- the documents to insertresultHandler
- an async result with a single element with the InsertManyResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException- Since:
- 1.7
- Since server release
- 3.6
-
insertMany
Future<InsertManyResult> insertMany(ClientSession clientSession, java.util.List<? extends TDocument> documents, InsertManyOptions options)
Inserts a batch of documents.- Parameters:
clientSession
- the client session with which to associate this operationdocuments
- the documents to insertoptions
- the options to apply to the operation- Returns:
- a future with a single element with the InsertManyResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException
- Since:
- 1.7
- Since server release
- 3.6
-
insertMany
void insertMany(ClientSession clientSession, java.util.List<? extends TDocument> documents, InsertManyOptions options, Handler<AsyncResult<InsertManyResult>> resultHandler)
Inserts a batch of documents.- Parameters:
clientSession
- the client session with which to associate this operationdocuments
- the documents to insertoptions
- the options to apply to the operationresultHandler
- an async result with a single element with the InsertManyResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException- Since:
- 1.7
- Since server release
- 3.6
-
deleteOne
Future<DeleteResult> deleteOne(JsonObject filter)
Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.- Parameters:
filter
- the query filter to apply the the delete operation- Returns:
- a future with a single element the DeleteResult or with an com.mongodb.MongoException
-
deleteOne
void deleteOne(JsonObject filter, Handler<AsyncResult<DeleteResult>> resultHandler)
Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.- Parameters:
filter
- the query filter to apply the the delete operationresultHandler
- an async result with a single element the DeleteResult or with an com.mongodb.MongoException
-
deleteOne
Future<DeleteResult> deleteOne(JsonObject filter, DeleteOptions options)
Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.- Parameters:
filter
- the query filter to apply the the delete operationoptions
- the options to apply to the delete operation- Returns:
- a future with a single element the DeleteResult or with an com.mongodb.MongoException
- Since:
- 1.5
-
deleteOne
void deleteOne(JsonObject filter, DeleteOptions options, Handler<AsyncResult<DeleteResult>> resultHandler)
Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.- Parameters:
filter
- the query filter to apply the the delete operationoptions
- the options to apply to the delete operationresultHandler
- an async result with a single element the DeleteResult or with an com.mongodb.MongoException- Since:
- 1.5
-
deleteOne
Future<DeleteResult> deleteOne(ClientSession clientSession, JsonObject filter)
Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filter to apply the the delete operation- Returns:
- a future with a single element the DeleteResult or with an com.mongodb.MongoException
- Since:
- 1.7
- Since server release
- 3.6
-
deleteOne
void deleteOne(ClientSession clientSession, JsonObject filter, Handler<AsyncResult<DeleteResult>> resultHandler)
Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filter to apply the the delete operationresultHandler
- an async result with a single element the DeleteResult or with an com.mongodb.MongoException- Since:
- 1.7
- Since server release
- 3.6
-
deleteOne
Future<DeleteResult> deleteOne(ClientSession clientSession, JsonObject filter, DeleteOptions options)
Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filter to apply the the delete operationoptions
- the options to apply to the delete operation- Returns:
- a future with a single element the DeleteResult or with an com.mongodb.MongoException
- Since:
- 1.7
- Since server release
- 3.6
-
deleteOne
void deleteOne(ClientSession clientSession, JsonObject filter, DeleteOptions options, Handler<AsyncResult<DeleteResult>> resultHandler)
Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filter to apply the the delete operationoptions
- the options to apply to the delete operationresultHandler
- an async result with a single element the DeleteResult or with an com.mongodb.MongoException- Since:
- 1.7
- Since server release
- 3.6
-
deleteMany
Future<DeleteResult> deleteMany(JsonObject filter)
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.- Parameters:
filter
- the query filter to apply the the delete operation- Returns:
- a future with a single element the DeleteResult or with an com.mongodb.MongoException
-
deleteMany
void deleteMany(JsonObject filter, Handler<AsyncResult<DeleteResult>> resultHandler)
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.- Parameters:
filter
- the query filter to apply the the delete operationresultHandler
- an async result with a single element the DeleteResult or with an com.mongodb.MongoException
-
deleteMany
Future<DeleteResult> deleteMany(JsonObject filter, DeleteOptions options)
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.- Parameters:
filter
- the query filter to apply the the delete operationoptions
- the options to apply to the delete operation- Returns:
- a future with a single element the DeleteResult or with an com.mongodb.MongoException
- Since:
- 1.5
-
deleteMany
void deleteMany(JsonObject filter, DeleteOptions options, Handler<AsyncResult<DeleteResult>> resultHandler)
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.- Parameters:
filter
- the query filter to apply the the delete operationoptions
- the options to apply to the delete operationresultHandler
- an async result with a single element the DeleteResult or with an com.mongodb.MongoException- Since:
- 1.5
-
deleteMany
Future<DeleteResult> deleteMany(ClientSession clientSession, JsonObject filter)
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filter to apply the the delete operation- Returns:
- a future with a single element the DeleteResult or with an com.mongodb.MongoException
- Since:
- 1.7
- Since server release
- 3.6
-
deleteMany
void deleteMany(ClientSession clientSession, JsonObject filter, Handler<AsyncResult<DeleteResult>> resultHandler)
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filter to apply the the delete operationresultHandler
- an async result with a single element the DeleteResult or with an com.mongodb.MongoException- Since:
- 1.7
- Since server release
- 3.6
-
deleteMany
Future<DeleteResult> deleteMany(ClientSession clientSession, JsonObject filter, DeleteOptions options)
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filter to apply the the delete operationoptions
- the options to apply to the delete operation- Returns:
- a future with a single element the DeleteResult or with an com.mongodb.MongoException
- Since:
- 1.7
- Since server release
- 3.6
-
deleteMany
void deleteMany(ClientSession clientSession, JsonObject filter, DeleteOptions options, Handler<AsyncResult<DeleteResult>> resultHandler)
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filter to apply the the delete operationoptions
- the options to apply to the delete operationresultHandler
- an async result with a single element the DeleteResult or with an com.mongodb.MongoException- Since:
- 1.7
- Since server release
- 3.6
-
replaceOne
Future<UpdateResult> replaceOne(JsonObject filter, TDocument replacement)
Replace a document in the collection according to the specified arguments.- Parameters:
filter
- the query filter to apply the the replace operationreplacement
- the replacement document- Returns:
- a future with a single element the UpdateResult
- MongoDB documentation
- Replace
-
replaceOne
void replaceOne(JsonObject filter, TDocument replacement, Handler<AsyncResult<UpdateResult>> resultHandler)
Replace a document in the collection according to the specified arguments.- Parameters:
filter
- the query filter to apply the the replace operationreplacement
- the replacement documentresultHandler
- an async result with a single element the UpdateResult- MongoDB documentation
- Replace
-
replaceOne
Future<UpdateResult> replaceOne(TDocument replacement)
Replace a document in the collection according to the specified arguments.The filter will be based on the id of the provided document
- Parameters:
replacement
- the replacement document- Returns:
- a future with a single element the UpdateResult
- MongoDB documentation
- Replace
-
replaceOne
void replaceOne(TDocument replacement, Handler<AsyncResult<UpdateResult>> resultHandler)
Replace a document in the collection according to the specified arguments.The filter will be based on the id of the provided document
- Parameters:
replacement
- the replacement documentresultHandler
- an async result with a single element the UpdateResult- MongoDB documentation
- Replace
-
replaceOne
Future<UpdateResult> replaceOne(JsonObject filter, TDocument replacement, ReplaceOptions options)
Replace a document in the collection according to the specified arguments.- Parameters:
filter
- the query filter to apply the the replace operationreplacement
- the replacement documentoptions
- the options to apply to the replace operation- Returns:
- a future with a single element the UpdateResult
- Since:
- 1.8
- MongoDB documentation
- Replace
-
replaceOne
void replaceOne(JsonObject filter, TDocument replacement, ReplaceOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Replace a document in the collection according to the specified arguments.- Parameters:
filter
- the query filter to apply the the replace operationreplacement
- the replacement documentoptions
- the options to apply to the replace operationresultHandler
- an async result with a single element the UpdateResult- Since:
- 1.8
- MongoDB documentation
- Replace
-
replaceOne
Future<UpdateResult> replaceOne(TDocument replacement, ReplaceOptions options)
Replace a document in the collection according to the specified arguments.The filter will be based on the id of the provided document
- Parameters:
replacement
- the replacement documentoptions
- the options to apply to the replace operation- Returns:
- a future with a single element the UpdateResult
- Since:
- 1.8
- MongoDB documentation
- Replace
-
replaceOne
void replaceOne(TDocument replacement, ReplaceOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Replace a document in the collection according to the specified arguments.The filter will be based on the id of the provided document
- Parameters:
replacement
- the replacement documentoptions
- the options to apply to the replace operationresultHandler
- an async result with a single element the UpdateResult- Since:
- 1.8
- MongoDB documentation
- Replace
-
replaceOne
Future<UpdateResult> replaceOne(ClientSession clientSession, JsonObject filter, TDocument replacement)
Replace a document in the collection according to the specified arguments.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filter to apply the the replace operationreplacement
- the replacement document- Returns:
- a future with a single element the UpdateResult
- Since:
- 1.7
-
replaceOne
void replaceOne(ClientSession clientSession, JsonObject filter, TDocument replacement, Handler<AsyncResult<UpdateResult>> resultHandler)
Replace a document in the collection according to the specified arguments.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filter to apply the the replace operationreplacement
- the replacement documentresultHandler
- an async result with a single element the UpdateResult- Since:
- 1.7
-
replaceOne
Future<UpdateResult> replaceOne(ClientSession clientSession, TDocument replacement)
Replace a document in the collection according to the specified arguments.The filter will be based on the id of the provided document
-
replaceOne
void replaceOne(ClientSession clientSession, TDocument replacement, Handler<AsyncResult<UpdateResult>> resultHandler)
Replace a document in the collection according to the specified arguments.The filter will be based on the id of the provided document
-
replaceOne
Future<UpdateResult> replaceOne(ClientSession clientSession, JsonObject filter, TDocument replacement, ReplaceOptions options)
Replace a document in the collection according to the specified arguments.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filter to apply the the replace operationreplacement
- the replacement documentoptions
- the options to apply to the replace operation- Returns:
- a future with a single element the UpdateResult
- Since:
- 1.8
-
replaceOne
void replaceOne(ClientSession clientSession, JsonObject filter, TDocument replacement, ReplaceOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Replace a document in the collection according to the specified arguments.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filter to apply the the replace operationreplacement
- the replacement documentoptions
- the options to apply to the replace operationresultHandler
- an async result with a single element the UpdateResult- Since:
- 1.8
-
replaceOne
Future<UpdateResult> replaceOne(ClientSession clientSession, TDocument replacement, ReplaceOptions options)
Replace a document in the collection according to the specified arguments.The filter will be based on the id of the provided document
- Parameters:
clientSession
- the client session with which to associate this operationreplacement
- the replacement documentoptions
- the options to apply to the replace operation- Returns:
- a future with a single element the UpdateResult
- Since:
- 1.8
-
replaceOne
void replaceOne(ClientSession clientSession, TDocument replacement, ReplaceOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Replace a document in the collection according to the specified arguments.The filter will be based on the id of the provided document
- Parameters:
clientSession
- the client session with which to associate this operationreplacement
- the replacement documentoptions
- the options to apply to the replace operationresultHandler
- an async result with a single element the UpdateResult- Since:
- 1.8
-
updateOne
Future<UpdateResult> updateOne(JsonObject filter, JsonObject update)
Update a single document in the collection according to the specified arguments.- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.- Returns:
- a future with a single element the UpdateResult
- MongoDB documentation
- Updates
- Update Operators
-
updateOne
void updateOne(JsonObject filter, JsonObject update, Handler<AsyncResult<UpdateResult>> resultHandler)
Update a single document in the collection according to the specified arguments.- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.resultHandler
- an async result with a single element the UpdateResult- MongoDB documentation
- Updates
- Update Operators
-
updateOne
Future<UpdateResult> updateOne(JsonObject filter, JsonObject update, UpdateOptions options)
Update a single document in the collection according to the specified arguments.- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.options
- the options to apply to the update operation- Returns:
- a future with a single element the UpdateResult
- MongoDB documentation
- Updates
- Update Operators
-
updateOne
void updateOne(JsonObject filter, JsonObject update, UpdateOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Update a single document in the collection according to the specified arguments.- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.options
- the options to apply to the update operationresultHandler
- an async result with a single element the UpdateResult- MongoDB documentation
- Updates
- Update Operators
-
updateOne
Future<UpdateResult> updateOne(ClientSession clientSession, JsonObject filter, JsonObject update)
Update a single document in the collection according to the specified arguments.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.- Returns:
- a future with a single element the UpdateResult
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Updates
- Update Operators
-
updateOne
void updateOne(ClientSession clientSession, JsonObject filter, JsonObject update, Handler<AsyncResult<UpdateResult>> resultHandler)
Update a single document in the collection according to the specified arguments.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.resultHandler
- an async result with a single element the UpdateResult- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Updates
- Update Operators
-
updateOne
Future<UpdateResult> updateOne(ClientSession clientSession, JsonObject filter, JsonObject update, UpdateOptions options)
Update a single document in the collection according to the specified arguments.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.options
- the options to apply to the update operation- Returns:
- a future with a single element the UpdateResult
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Updates
- Update Operators
-
updateOne
void updateOne(ClientSession clientSession, JsonObject filter, JsonObject update, UpdateOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Update a single document in the collection according to the specified arguments.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.options
- the options to apply to the update operationresultHandler
- an async result with a single element the UpdateResult- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Updates
- Update Operators
-
updateOne
Future<UpdateResult> updateOne(JsonObject filter, JsonArray update)
Update a single document in the collection according to the specified arguments.Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.- Returns:
- a future with a single element the UpdateResult
- Since:
- 1.12
- Since server release
- 4.2
- MongoDB documentation
- Updates
- Update Operators
-
updateOne
void updateOne(JsonObject filter, JsonArray update, Handler<AsyncResult<UpdateResult>> resultHandler)
Update a single document in the collection according to the specified arguments.Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.resultHandler
- an async result with a single element the UpdateResult- Since:
- 1.12
- Since server release
- 4.2
- MongoDB documentation
- Updates
- Update Operators
-
updateOne
Future<UpdateResult> updateOne(JsonObject filter, JsonArray update, UpdateOptions options)
Update a single document in the collection according to the specified arguments.Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.options
- the options to apply to the update operation- Returns:
- a future with a single element the UpdateResult
- Since:
- 1.12
- Since server release
- 4.2
- MongoDB documentation
- Updates
- Update Operators
-
updateOne
void updateOne(JsonObject filter, JsonArray update, UpdateOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Update a single document in the collection according to the specified arguments.Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.options
- the options to apply to the update operationresultHandler
- an async result with a single element the UpdateResult- Since:
- 1.12
- Since server release
- 4.2
- MongoDB documentation
- Updates
- Update Operators
-
updateOne
Future<UpdateResult> updateOne(ClientSession clientSession, JsonObject filter, JsonArray update)
Update a single document in the collection according to the specified arguments.Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.- Returns:
- a future with a single element the UpdateResult
- Since:
- 1.12
- Since server release
- 4.2
- MongoDB documentation
- Updates
- Update Operators
-
updateOne
void updateOne(ClientSession clientSession, JsonObject filter, JsonArray update, Handler<AsyncResult<UpdateResult>> resultHandler)
Update a single document in the collection according to the specified arguments.Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.resultHandler
- an async result with a single element the UpdateResult- Since:
- 1.12
- Since server release
- 4.2
- MongoDB documentation
- Updates
- Update Operators
-
updateOne
Future<UpdateResult> updateOne(ClientSession clientSession, JsonObject filter, JsonArray update, UpdateOptions options)
Update a single document in the collection according to the specified arguments.Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.options
- the options to apply to the update operation- Returns:
- a future with a single element the UpdateResult
- Since:
- 1.12
- Since server release
- 4.2
- MongoDB documentation
- Updates
- Update Operators
-
updateOne
void updateOne(ClientSession clientSession, JsonObject filter, JsonArray update, UpdateOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Update a single document in the collection according to the specified arguments.Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.options
- the options to apply to the update operationresultHandler
- an async result with a single element the UpdateResult- Since:
- 1.12
- Since server release
- 4.2
- MongoDB documentation
- Updates
- Update Operators
-
updateMany
Future<UpdateResult> updateMany(JsonObject filter, JsonObject update)
Update all documents in the collection according to the specified arguments.- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.- Returns:
- a future with a single element the UpdateResult
- MongoDB documentation
- Updates
- Update Operators
-
updateMany
void updateMany(JsonObject filter, JsonObject update, Handler<AsyncResult<UpdateResult>> resultHandler)
Update all documents in the collection according to the specified arguments.- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.resultHandler
- an async result with a single element the UpdateResult- MongoDB documentation
- Updates
- Update Operators
-
updateMany
Future<UpdateResult> updateMany(JsonObject filter, JsonObject update, UpdateOptions options)
Update all documents in the collection according to the specified arguments.- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.options
- the options to apply to the update operation- Returns:
- a future with a single element the UpdateResult
- MongoDB documentation
- Updates
- Update Operators
-
updateMany
void updateMany(JsonObject filter, JsonObject update, UpdateOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Update all documents in the collection according to the specified arguments.- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.options
- the options to apply to the update operationresultHandler
- an async result with a single element the UpdateResult- MongoDB documentation
- Updates
- Update Operators
-
updateMany
Future<UpdateResult> updateMany(ClientSession clientSession, JsonObject filter, JsonObject update)
Update all documents in the collection according to the specified arguments.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.- Returns:
- a future with a single element the UpdateResult
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Updates
- Update Operators
-
updateMany
void updateMany(ClientSession clientSession, JsonObject filter, JsonObject update, Handler<AsyncResult<UpdateResult>> resultHandler)
Update all documents in the collection according to the specified arguments.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.resultHandler
- an async result with a single element the UpdateResult- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Updates
- Update Operators
-
updateMany
Future<UpdateResult> updateMany(ClientSession clientSession, JsonObject filter, JsonObject update, UpdateOptions options)
Update all documents in the collection according to the specified arguments.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.options
- the options to apply to the update operation- Returns:
- a future with a single element the UpdateResult
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Updates
- Update Operators
-
updateMany
void updateMany(ClientSession clientSession, JsonObject filter, JsonObject update, UpdateOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Update all documents in the collection according to the specified arguments.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.options
- the options to apply to the update operationresultHandler
- an async result with a single element the UpdateResult- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Updates
- Update Operators
-
updateMany
Future<UpdateResult> updateMany(JsonObject filter, JsonArray update)
Update all documents in the collection according to the specified arguments.- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.- Returns:
- a future with a single element the UpdateResult
- Since:
- 1.12
- Since server release
- 4.2
- MongoDB documentation
- Updates
- Update Operators
-
updateMany
void updateMany(JsonObject filter, JsonArray update, Handler<AsyncResult<UpdateResult>> resultHandler)
Update all documents in the collection according to the specified arguments.- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.resultHandler
- an async result with a single element the UpdateResult- Since:
- 1.12
- Since server release
- 4.2
- MongoDB documentation
- Updates
- Update Operators
-
updateMany
Future<UpdateResult> updateMany(JsonObject filter, JsonArray update, UpdateOptions options)
Update all documents in the collection according to the specified arguments.- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.options
- the options to apply to the update operation- Returns:
- a future with a single element the UpdateResult
- Since:
- 1.12
- Since server release
- 4.2
- MongoDB documentation
- Updates
- Update Operators
-
updateMany
void updateMany(JsonObject filter, JsonArray update, UpdateOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Update all documents in the collection according to the specified arguments.- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.options
- the options to apply to the update operationresultHandler
- an async result with a single element the UpdateResult- Since:
- 1.12
- Since server release
- 4.2
- MongoDB documentation
- Updates
- Update Operators
-
updateMany
Future<UpdateResult> updateMany(ClientSession clientSession, JsonObject filter, JsonArray update)
Update all documents in the collection according to the specified arguments.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.- Returns:
- a future with a single element the UpdateResult
- Since:
- 1.12
- Since server release
- 4.2
- MongoDB documentation
- Updates
- Update Operators
-
updateMany
void updateMany(ClientSession clientSession, JsonObject filter, JsonArray update, Handler<AsyncResult<UpdateResult>> resultHandler)
Update all documents in the collection according to the specified arguments.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.resultHandler
- an async result with a single element the UpdateResult- Since:
- 1.12
- Since server release
- 4.2
- MongoDB documentation
- Updates
- Update Operators
-
updateMany
Future<UpdateResult> updateMany(ClientSession clientSession, JsonObject filter, JsonArray update, UpdateOptions options)
Update all documents in the collection according to the specified arguments.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.options
- the options to apply to the update operation- Returns:
- a future with a single element the UpdateResult
- Since:
- 1.12
- Since server release
- 4.2
- MongoDB documentation
- Updates
- Update Operators
-
updateMany
void updateMany(ClientSession clientSession, JsonObject filter, JsonArray update, UpdateOptions options, Handler<AsyncResult<UpdateResult>> resultHandler)
Update all documents in the collection according to the specified arguments.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.options
- the options to apply to the update operationresultHandler
- an async result with a single element the UpdateResult- Since:
- 1.12
- Since server release
- 4.2
- MongoDB documentation
- Updates
- Update Operators
-
findOneAndDelete
Future<TDocument> findOneAndDelete(JsonObject filter)
Atomically find a document and remove it.- Parameters:
filter
- the query filter to find the document with- Returns:
- a future with a single element the document that was removed. If no documents matched the query filter, then null will be returned
-
findOneAndDelete
void findOneAndDelete(JsonObject filter, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and remove it.- Parameters:
filter
- the query filter to find the document withresultHandler
- an async result with a single element the document that was removed. If no documents matched the query filter, then null will be returned
-
findOneAndDelete
Future<TDocument> findOneAndDelete(JsonObject filter, FindOneAndDeleteOptions options)
Atomically find a document and remove it.- Parameters:
filter
- the query filter to find the document withoptions
- the options to apply to the operation- Returns:
- a future with a single element the document that was removed. If no documents matched the query filter, then null will be returned
-
findOneAndDelete
void findOneAndDelete(JsonObject filter, FindOneAndDeleteOptions options, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and remove it.- Parameters:
filter
- the query filter to find the document withoptions
- the options to apply to the operationresultHandler
- an async result with a single element the document that was removed. If no documents matched the query filter, then null will be returned
-
findOneAndDelete
Future<TDocument> findOneAndDelete(ClientSession clientSession, JsonObject filter)
Atomically find a document and remove it.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filter to find the document with- Returns:
- a future with a single element the document that was removed. If no documents matched the query filter, then null will be returned
- Since:
- 1.7
- Since server release
- 3.6
-
findOneAndDelete
void findOneAndDelete(ClientSession clientSession, JsonObject filter, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and remove it.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filter to find the document withresultHandler
- an async result with a single element the document that was removed. If no documents matched the query filter, then null will be returned- Since:
- 1.7
- Since server release
- 3.6
-
findOneAndDelete
Future<TDocument> findOneAndDelete(ClientSession clientSession, JsonObject filter, FindOneAndDeleteOptions options)
Atomically find a document and remove it.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filter to find the document withoptions
- the options to apply to the operation- Returns:
- a future with a single element the document that was removed. If no documents matched the query filter, then null will be returned
- Since:
- 1.7
- Since server release
- 3.6
-
findOneAndDelete
void findOneAndDelete(ClientSession clientSession, JsonObject filter, FindOneAndDeleteOptions options, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and remove it.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filter to find the document withoptions
- the options to apply to the operationresultHandler
- an async result with a single element the document that was removed. If no documents matched the query filter, then null will be returned- Since:
- 1.7
- Since server release
- 3.6
-
findOneAndReplace
Future<TDocument> findOneAndReplace(JsonObject filter, TDocument replacement)
Atomically find a document and replace it.- Parameters:
filter
- the query filter to apply the the replace operationreplacement
- the replacement document- Returns:
- a future with a single element the document that was replaced. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned
-
findOneAndReplace
void findOneAndReplace(JsonObject filter, TDocument replacement, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and replace it.- Parameters:
filter
- the query filter to apply the the replace operationreplacement
- the replacement documentresultHandler
- an async result with a single element the document that was replaced. Depending on the value of thereturnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned
-
findOneAndReplace
Future<TDocument> findOneAndReplace(JsonObject filter, TDocument replacement, FindOneAndReplaceOptions options)
Atomically find a document and replace it.- Parameters:
filter
- the query filter to apply the the replace operationreplacement
- the replacement documentoptions
- the options to apply to the operation- Returns:
- a future with a single element the document that was replaced. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned
-
findOneAndReplace
void findOneAndReplace(JsonObject filter, TDocument replacement, FindOneAndReplaceOptions options, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and replace it.- Parameters:
filter
- the query filter to apply the the replace operationreplacement
- the replacement documentoptions
- the options to apply to the operationresultHandler
- an async result with a single element the document that was replaced. Depending on the value of thereturnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned
-
findOneAndReplace
Future<TDocument> findOneAndReplace(ClientSession clientSession, JsonObject filter, TDocument replacement)
Atomically find a document and replace it.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filter to apply the the replace operationreplacement
- the replacement document- Returns:
- a future with a single element the document that was replaced. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned - Since:
- 1.7
- Since server release
- 3.6
-
findOneAndReplace
void findOneAndReplace(ClientSession clientSession, JsonObject filter, TDocument replacement, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and replace it.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filter to apply the the replace operationreplacement
- the replacement documentresultHandler
- an async result with a single element the document that was replaced. Depending on the value of thereturnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned- Since:
- 1.7
- Since server release
- 3.6
-
findOneAndReplace
Future<TDocument> findOneAndReplace(ClientSession clientSession, JsonObject filter, TDocument replacement, FindOneAndReplaceOptions options)
Atomically find a document and replace it.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filter to apply the the replace operationreplacement
- the replacement documentoptions
- the options to apply to the operation- Returns:
- a future with a single element the document that was replaced. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned - Since:
- 1.7
- Since server release
- 3.6
-
findOneAndReplace
void findOneAndReplace(ClientSession clientSession, JsonObject filter, TDocument replacement, FindOneAndReplaceOptions options, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and replace it.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- the query filter to apply the the replace operationreplacement
- the replacement documentoptions
- the options to apply to the operationresultHandler
- an async result with a single element the document that was replaced. Depending on the value of thereturnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned- Since:
- 1.7
- Since server release
- 3.6
-
findOneAndUpdate
Future<TDocument> findOneAndUpdate(JsonObject filter, JsonObject update)
Atomically find a document and update it.- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.- Returns:
- a future with a single element the document that was updated before the update was applied. If no documents matched the query filter, then null will be returned
-
findOneAndUpdate
void findOneAndUpdate(JsonObject filter, JsonObject update, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and update it.- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.resultHandler
- an async result with a single element the document that was updated before the update was applied. If no documents matched the query filter, then null will be returned
-
findOneAndUpdate
Future<TDocument> findOneAndUpdate(JsonObject filter, JsonObject update, FindOneAndUpdateOptions options)
Atomically find a document and update it.- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.options
- the options to apply to the operation- Returns:
- a future with a single element the document that was updated. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned
-
findOneAndUpdate
void findOneAndUpdate(JsonObject filter, JsonObject update, FindOneAndUpdateOptions options, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and update it.- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.options
- the options to apply to the operationresultHandler
- an async result with a single element the document that was updated. Depending on the value of thereturnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned
-
findOneAndUpdate
Future<TDocument> findOneAndUpdate(ClientSession clientSession, JsonObject filter, JsonObject update)
Atomically find a document and update it.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.- Returns:
- a future with a single element the document that was updated before the update was applied. If no documents matched the query filter, then null will be returned
- Since:
- 1.7
- Since server release
- 3.6
-
findOneAndUpdate
void findOneAndUpdate(ClientSession clientSession, JsonObject filter, JsonObject update, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and update it.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.resultHandler
- an async result with a single element the document that was updated before the update was applied. If no documents matched the query filter, then null will be returned- Since:
- 1.7
- Since server release
- 3.6
-
findOneAndUpdate
Future<TDocument> findOneAndUpdate(ClientSession clientSession, JsonObject filter, JsonObject update, FindOneAndUpdateOptions options)
Atomically find a document and update it.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.options
- the options to apply to the operation- Returns:
- a future with a single element the document that was updated. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned - Since:
- 1.7
- Since server release
- 3.6
-
findOneAndUpdate
void findOneAndUpdate(ClientSession clientSession, JsonObject filter, JsonObject update, FindOneAndUpdateOptions options, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and update it.- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.options
- the options to apply to the operationresultHandler
- an async result with a single element the document that was updated. Depending on the value of thereturnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned- Since:
- 1.7
- Since server release
- 3.6
-
findOneAndUpdate
Future<TDocument> findOneAndUpdate(JsonObject filter, JsonArray update)
Atomically find a document and update it.Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.- Returns:
- a future with a single element the document that was updated. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned - Since:
- 1.12
- Since server release
- 4.2
-
findOneAndUpdate
void findOneAndUpdate(JsonObject filter, JsonArray update, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and update it.Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.resultHandler
- an async result with a single element the document that was updated. Depending on the value of thereturnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned- Since:
- 1.12
- Since server release
- 4.2
-
findOneAndUpdate
Future<TDocument> findOneAndUpdate(JsonObject filter, JsonArray update, FindOneAndUpdateOptions options)
Atomically find a document and update it.Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.options
- the options to apply to the operation- Returns:
- a future with a single element the document that was updated. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned - Since:
- 1.12
- Since server release
- 4.2
-
findOneAndUpdate
void findOneAndUpdate(JsonObject filter, JsonArray update, FindOneAndUpdateOptions options, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and update it.Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
- Parameters:
filter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.options
- the options to apply to the operationresultHandler
- an async result with a single element the document that was updated. Depending on the value of thereturnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned- Since:
- 1.12
- Since server release
- 4.2
-
findOneAndUpdate
Future<TDocument> findOneAndUpdate(ClientSession clientSession, JsonObject filter, JsonArray update)
Atomically find a document and update it.Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.- Returns:
- a future with a single element the document that was updated. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned - Since:
- 1.12
- Since server release
- 4.2
-
findOneAndUpdate
void findOneAndUpdate(ClientSession clientSession, JsonObject filter, JsonArray update, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and update it.Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.resultHandler
- an async result with a single element the document that was updated. Depending on the value of thereturnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned- Since:
- 1.12
- Since server release
- 4.2
-
findOneAndUpdate
Future<TDocument> findOneAndUpdate(ClientSession clientSession, JsonObject filter, JsonArray update, FindOneAndUpdateOptions options)
Atomically find a document and update it.Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.options
- the options to apply to the operation- Returns:
- a future with a single element the document that was updated. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned - Since:
- 1.12
- Since server release
- 4.2
-
findOneAndUpdate
void findOneAndUpdate(ClientSession clientSession, JsonObject filter, JsonArray update, FindOneAndUpdateOptions options, Handler<AsyncResult<TDocument>> resultHandler)
Atomically find a document and update it.Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
- Parameters:
clientSession
- the client session with which to associate this operationfilter
- a document describing the query filter, which may not be null.update
- a pipeline describing the update, which may not be null.options
- the options to apply to the operationresultHandler
- an async result with a single element the document that was updated. Depending on the value of thereturnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned- Since:
- 1.12
- Since server release
- 4.2
-
drop
Future<java.lang.Void> drop()
Drops this collection from the Database.- Returns:
- an empty future that indicates when the operation has completed
- MongoDB documentation
- Drop Collection
-
drop
void drop(Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops this collection from the Database.- Parameters:
resultHandler
- an empty async result that indicates when the operation has completed- MongoDB documentation
- Drop Collection
-
drop
Future<java.lang.Void> drop(ClientSession clientSession)
Drops this collection from the Database.- Parameters:
clientSession
- the client session with which to associate this operation- Returns:
- an empty future that indicates when the operation has completed
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Drop Collection
-
drop
void drop(ClientSession clientSession, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops this collection from the Database.- Parameters:
clientSession
- the client session with which to associate this operationresultHandler
- an empty async result that indicates when the operation has completed- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Drop Collection
-
createIndex
Future<java.lang.String> createIndex(JsonObject key)
Creates an index.- Parameters:
key
- an object describing the index key(s), which may not be null.- Returns:
- an empty future that indicates when the operation has completed
- MongoDB documentation
- Ensure Index
-
createIndex
void createIndex(JsonObject key, Handler<AsyncResult<java.lang.String>> resultHandler)
Creates an index.- Parameters:
key
- an object describing the index key(s), which may not be null.resultHandler
- an empty async result that indicates when the operation has completed- MongoDB documentation
- Ensure Index
-
createIndex
Future<java.lang.String> createIndex(JsonObject key, IndexOptions options)
Creates an index.- Parameters:
key
- an object describing the index key(s), which may not be null.options
- the options for the index- Returns:
- an empty future that indicates when the operation has completed
- MongoDB documentation
- Ensure Index
-
createIndex
void createIndex(JsonObject key, IndexOptions options, Handler<AsyncResult<java.lang.String>> resultHandler)
Creates an index.- Parameters:
key
- an object describing the index key(s), which may not be null.options
- the options for the indexresultHandler
- an empty async result that indicates when the operation has completed- MongoDB documentation
- Ensure Index
-
createIndex
Future<java.lang.String> createIndex(ClientSession clientSession, JsonObject key)
Creates an index.- Parameters:
clientSession
- the client session with which to associate this operationkey
- an object describing the index key(s), which may not be null.- Returns:
- an empty future that indicates when the operation has completed
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Ensure Index
-
createIndex
void createIndex(ClientSession clientSession, JsonObject key, Handler<AsyncResult<java.lang.String>> resultHandler)
Creates an index.- Parameters:
clientSession
- the client session with which to associate this operationkey
- an object describing the index key(s), which may not be null.resultHandler
- an empty async result that indicates when the operation has completed- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Ensure Index
-
createIndex
Future<java.lang.String> createIndex(ClientSession clientSession, JsonObject key, IndexOptions options)
Creates an index.- Parameters:
clientSession
- the client session with which to associate this operationkey
- an object describing the index key(s), which may not be null.options
- the options for the index- Returns:
- an empty future that indicates when the operation has completed
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Ensure Index
-
createIndex
void createIndex(ClientSession clientSession, JsonObject key, IndexOptions options, Handler<AsyncResult<java.lang.String>> resultHandler)
Creates an index.- Parameters:
clientSession
- the client session with which to associate this operationkey
- an object describing the index key(s), which may not be null.options
- the options for the indexresultHandler
- an empty async result that indicates when the operation has completed- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Ensure Index
-
createIndexes
Future<java.lang.String> createIndexes(java.util.List<IndexModel> indexes)
Create multiple indexes.- Parameters:
indexes
- the list of indexes- Returns:
- an empty future that indicates when the operation has completed
- MongoDB documentation
- Create indexes
-
createIndexes
void createIndexes(java.util.List<IndexModel> indexes, Handler<AsyncResult<java.lang.String>> resultHandler)
Create multiple indexes.- Parameters:
indexes
- the list of indexesresultHandler
- an empty async result that indicates when the operation has completed- MongoDB documentation
- Create indexes
-
createIndexes
Future<java.lang.String> createIndexes(java.util.List<IndexModel> indexes, CreateIndexOptions createIndexOptions)
Create multiple indexes.- Parameters:
indexes
- the list of indexescreateIndexOptions
- options to use when creating indexes- Returns:
- an empty future that indicates when the operation has completed
- Since:
- 1.7
- MongoDB documentation
- Create indexes
-
createIndexes
void createIndexes(java.util.List<IndexModel> indexes, CreateIndexOptions createIndexOptions, Handler<AsyncResult<java.lang.String>> resultHandler)
Create multiple indexes.- Parameters:
indexes
- the list of indexescreateIndexOptions
- options to use when creating indexesresultHandler
- an empty async result that indicates when the operation has completed- Since:
- 1.7
- MongoDB documentation
- Create indexes
-
createIndexes
Future<java.lang.String> createIndexes(ClientSession clientSession, java.util.List<IndexModel> indexes)
Create multiple indexes.- Parameters:
clientSession
- the client session with which to associate this operationindexes
- the list of indexes- Returns:
- an empty future that indicates when the operation has completed
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Create indexes
-
createIndexes
void createIndexes(ClientSession clientSession, java.util.List<IndexModel> indexes, Handler<AsyncResult<java.lang.String>> resultHandler)
Create multiple indexes.- Parameters:
clientSession
- the client session with which to associate this operationindexes
- the list of indexesresultHandler
- an empty async result that indicates when the operation has completed- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Create indexes
-
createIndexes
Future<java.lang.String> createIndexes(ClientSession clientSession, java.util.List<IndexModel> indexes, CreateIndexOptions createIndexOptions)
Create multiple indexes.- Parameters:
clientSession
- the client session with which to associate this operationindexes
- the list of indexescreateIndexOptions
- options to use when creating indexes- Returns:
- an empty future that indicates when the operation has completed
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Create indexes
-
createIndexes
void createIndexes(ClientSession clientSession, java.util.List<IndexModel> indexes, CreateIndexOptions createIndexOptions, Handler<AsyncResult<java.lang.String>> resultHandler)
Create multiple indexes.- Parameters:
clientSession
- the client session with which to associate this operationindexes
- the list of indexescreateIndexOptions
- options to use when creating indexesresultHandler
- an empty async result that indicates when the operation has completed- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Create indexes
-
listIndexes
MongoResult<JsonObject> listIndexes()
Get all the indexes in this collection.- Returns:
- the fluent list indexes interface
- MongoDB documentation
- listIndexes
-
listIndexes
MongoResult<JsonObject> listIndexes(ListIndexesOptions options)
Get all the indexes in this collection.- Parameters:
options
- options- Returns:
- the fluent list indexes interface
- MongoDB documentation
- listIndexes
-
listIndexes
MongoResult<JsonObject> listIndexes(ClientSession clientSession)
Get all the indexes in this collection.- Parameters:
clientSession
- the client session with which to associate this operation- Returns:
- the fluent list indexes interface
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- listIndexes
-
listIndexes
MongoResult<JsonObject> listIndexes(ClientSession clientSession, ListIndexesOptions options)
Get all the indexes in this collection.- Parameters:
clientSession
- the client session with which to associate this operationoptions
- options- Returns:
- the fluent list indexes interface
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- listIndexes
-
dropIndex
Future<java.lang.Void> dropIndex(java.lang.String indexName)
Drops the given index.- Parameters:
indexName
- the name of the index to remove- Returns:
- an empty future that indicates when the operation has completed
- MongoDB documentation
- Drop Indexes
-
dropIndex
void dropIndex(java.lang.String indexName, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops the given index.- Parameters:
indexName
- the name of the index to removeresultHandler
- an empty async result that indicates when the operation has completed- MongoDB documentation
- Drop Indexes
-
dropIndex
Future<java.lang.Void> dropIndex(JsonObject keys)
Drops the index given the keys used to create it.- Parameters:
keys
- the keys of the index to remove- Returns:
- an empty future that indicates when the operation has completed
- MongoDB documentation
- Drop indexes
-
dropIndex
void dropIndex(JsonObject keys, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops the index given the keys used to create it.- Parameters:
keys
- the keys of the index to removeresultHandler
- an empty async result that indicates when the operation has completed- MongoDB documentation
- Drop indexes
-
dropIndex
Future<java.lang.Void> dropIndex(java.lang.String indexName, DropIndexOptions dropIndexOptions)
Drops the given index.- Parameters:
indexName
- the name of the index to removedropIndexOptions
- options to use when dropping indexes- Returns:
- an empty future that indicates when the operation has completed
- Since:
- 1.7
- MongoDB documentation
- Drop Indexes
-
dropIndex
void dropIndex(java.lang.String indexName, DropIndexOptions dropIndexOptions, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops the given index.- Parameters:
indexName
- the name of the index to removedropIndexOptions
- options to use when dropping indexesresultHandler
- an empty async result that indicates when the operation has completed- Since:
- 1.7
- MongoDB documentation
- Drop Indexes
-
dropIndex
Future<java.lang.Void> dropIndex(JsonObject keys, DropIndexOptions dropIndexOptions)
Drops the index given the keys used to create it.- Parameters:
keys
- the keys of the index to removedropIndexOptions
- options to use when dropping indexes- Returns:
- an empty future that indicates when the operation has completed
- Since:
- 1.7
- MongoDB documentation
- Drop indexes
-
dropIndex
void dropIndex(JsonObject keys, DropIndexOptions dropIndexOptions, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops the index given the keys used to create it.- Parameters:
keys
- the keys of the index to removedropIndexOptions
- options to use when dropping indexesresultHandler
- an empty async result that indicates when the operation has completed- Since:
- 1.7
- MongoDB documentation
- Drop indexes
-
dropIndex
Future<java.lang.Void> dropIndex(ClientSession clientSession, java.lang.String indexName)
Drops the given index.- Parameters:
clientSession
- the client session with which to associate this operationindexName
- the name of the index to remove- Returns:
- an empty future that indicates when the operation has completed
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Drop Indexes
-
dropIndex
void dropIndex(ClientSession clientSession, java.lang.String indexName, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops the given index.- Parameters:
clientSession
- the client session with which to associate this operationindexName
- the name of the index to removeresultHandler
- an empty async result that indicates when the operation has completed- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Drop Indexes
-
dropIndex
Future<java.lang.Void> dropIndex(ClientSession clientSession, JsonObject keys)
Drops the index given the keys used to create it.- Parameters:
clientSession
- the client session with which to associate this operationkeys
- the keys of the index to remove- Returns:
- an empty future that indicates when the operation has completed
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Drop indexes
-
dropIndex
void dropIndex(ClientSession clientSession, JsonObject keys, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops the index given the keys used to create it.- Parameters:
clientSession
- the client session with which to associate this operationkeys
- the keys of the index to removeresultHandler
- an empty async result that indicates when the operation has completed- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Drop indexes
-
dropIndex
Future<java.lang.Void> dropIndex(ClientSession clientSession, java.lang.String indexName, DropIndexOptions dropIndexOptions)
Drops the given index.- Parameters:
clientSession
- the client session with which to associate this operationindexName
- the name of the index to removedropIndexOptions
- options to use when dropping indexes- Returns:
- an empty future that indicates when the operation has completed
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Drop Indexes
-
dropIndex
void dropIndex(ClientSession clientSession, java.lang.String indexName, DropIndexOptions dropIndexOptions, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops the given index.- Parameters:
clientSession
- the client session with which to associate this operationindexName
- the name of the index to removedropIndexOptions
- options to use when dropping indexesresultHandler
- an empty async result that indicates when the operation has completed- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Drop Indexes
-
dropIndex
Future<java.lang.Void> dropIndex(ClientSession clientSession, JsonObject keys, DropIndexOptions dropIndexOptions)
Drops the index given the keys used to create it.- Parameters:
clientSession
- the client session with which to associate this operationkeys
- the keys of the index to removedropIndexOptions
- options to use when dropping indexes- Returns:
- an empty future that indicates when the operation has completed
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Drop indexes
-
dropIndex
void dropIndex(ClientSession clientSession, JsonObject keys, DropIndexOptions dropIndexOptions, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drops the index given the keys used to create it.- Parameters:
clientSession
- the client session with which to associate this operationkeys
- the keys of the index to removedropIndexOptions
- options to use when dropping indexesresultHandler
- an empty async result that indicates when the operation has completed- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Drop indexes
-
dropIndexes
Future<java.lang.Void> dropIndexes()
Drop all the indexes on this collection, except for the default on _id.- Returns:
- an empty future that indicates when the operation has completed
- MongoDB documentation
- Drop Indexes
-
dropIndexes
void dropIndexes(Handler<AsyncResult<java.lang.Void>> resultHandler)
Drop all the indexes on this collection, except for the default on _id.- Parameters:
resultHandler
- an empty async result that indicates when the operation has completed- MongoDB documentation
- Drop Indexes
-
dropIndexes
Future<java.lang.Void> dropIndexes(DropIndexOptions dropIndexOptions)
Drop all the indexes on this collection, except for the default on _id.- Parameters:
dropIndexOptions
- options to use when dropping indexes- Returns:
- an empty future that indicates when the operation has completed
- Since:
- 1.7
- MongoDB documentation
- Drop Indexes
-
dropIndexes
void dropIndexes(DropIndexOptions dropIndexOptions, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drop all the indexes on this collection, except for the default on _id.- Parameters:
dropIndexOptions
- options to use when dropping indexesresultHandler
- an empty async result that indicates when the operation has completed- Since:
- 1.7
- MongoDB documentation
- Drop Indexes
-
dropIndexes
Future<java.lang.Void> dropIndexes(ClientSession clientSession)
Drop all the indexes on this collection, except for the default on _id.- Parameters:
clientSession
- the client session with which to associate this operation- Returns:
- an empty future that indicates when the operation has completed
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Drop Indexes
-
dropIndexes
void dropIndexes(ClientSession clientSession, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drop all the indexes on this collection, except for the default on _id.- Parameters:
clientSession
- the client session with which to associate this operationresultHandler
- an empty async result that indicates when the operation has completed- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Drop Indexes
-
dropIndexes
Future<java.lang.Void> dropIndexes(ClientSession clientSession, DropIndexOptions dropIndexOptions)
Drop all the indexes on this collection, except for the default on _id.- Parameters:
clientSession
- the client session with which to associate this operationdropIndexOptions
- options to use when dropping indexes- Returns:
- an empty future that indicates when the operation has completed
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Drop Indexes
-
dropIndexes
void dropIndexes(ClientSession clientSession, DropIndexOptions dropIndexOptions, Handler<AsyncResult<java.lang.Void>> resultHandler)
Drop all the indexes on this collection, except for the default on _id.- Parameters:
clientSession
- the client session with which to associate this operationdropIndexOptions
- options to use when dropping indexesresultHandler
- an empty async result that indicates when the operation has completed- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Drop Indexes
-
renameCollection
Future<java.lang.Void> renameCollection(MongoNamespace newCollectionNamespace)
Rename the collection with oldCollectionName to the newCollectionName.- Parameters:
newCollectionNamespace
- the namespace the collection will be renamed to- Returns:
- an empty future that indicates when the operation has completed
- MongoDB documentation
- Rename collection
-
renameCollection
void renameCollection(MongoNamespace newCollectionNamespace, Handler<AsyncResult<java.lang.Void>> resultHandler)
Rename the collection with oldCollectionName to the newCollectionName.- Parameters:
newCollectionNamespace
- the namespace the collection will be renamed toresultHandler
- an empty async result that indicates when the operation has completed- MongoDB documentation
- Rename collection
-
renameCollection
Future<java.lang.Void> renameCollection(MongoNamespace newCollectionNamespace, RenameCollectionOptions options)
Rename the collection with oldCollectionName to the newCollectionName.- Parameters:
newCollectionNamespace
- the name the collection will be renamed tooptions
- the options for renaming a collection- Returns:
- an empty future that indicates when the operation has completed
- MongoDB documentation
- Rename collection
-
renameCollection
void renameCollection(MongoNamespace newCollectionNamespace, RenameCollectionOptions options, Handler<AsyncResult<java.lang.Void>> resultHandler)
Rename the collection with oldCollectionName to the newCollectionName.- Parameters:
newCollectionNamespace
- the name the collection will be renamed tooptions
- the options for renaming a collectionresultHandler
- an empty async result that indicates when the operation has completed- MongoDB documentation
- Rename collection
-
renameCollection
Future<java.lang.Void> renameCollection(ClientSession clientSession, MongoNamespace newCollectionNamespace)
Rename the collection with oldCollectionName to the newCollectionName.- Parameters:
clientSession
- the client session with which to associate this operationnewCollectionNamespace
- the namespace the collection will be renamed to- Returns:
- an empty future that indicates when the operation has completed
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Rename collection
-
renameCollection
void renameCollection(ClientSession clientSession, MongoNamespace newCollectionNamespace, Handler<AsyncResult<java.lang.Void>> resultHandler)
Rename the collection with oldCollectionName to the newCollectionName.- Parameters:
clientSession
- the client session with which to associate this operationnewCollectionNamespace
- the namespace the collection will be renamed toresultHandler
- an empty async result that indicates when the operation has completed- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Rename collection
-
renameCollection
Future<java.lang.Void> renameCollection(ClientSession clientSession, MongoNamespace newCollectionNamespace, RenameCollectionOptions options)
Rename the collection with oldCollectionName to the newCollectionName.- Parameters:
clientSession
- the client session with which to associate this operationnewCollectionNamespace
- the name the collection will be renamed tooptions
- the options for renaming a collection- Returns:
- an empty future that indicates when the operation has completed
- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Rename collection
-
renameCollection
void renameCollection(ClientSession clientSession, MongoNamespace newCollectionNamespace, RenameCollectionOptions options, Handler<AsyncResult<java.lang.Void>> resultHandler)
Rename the collection with oldCollectionName to the newCollectionName.- Parameters:
clientSession
- the client session with which to associate this operationnewCollectionNamespace
- the name the collection will be renamed tooptions
- the options for renaming a collectionresultHandler
- an empty async result that indicates when the operation has completed- Since:
- 1.7
- Since server release
- 3.6
- MongoDB documentation
- Rename collection
-
-