Class MongoClient
- java.lang.Object
-
- io.vertx.mutiny.ext.mongo.MongoClient
-
public class MongoClient extends Object
A Vert.x service used to interact with MongoDB server instances.Some of the operations might change _id field of passed document.
NOTE: This class has been automatically generated from theoriginal
non Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<MongoClient>
__TYPE_ARG
static String
DEFAULT_DB_NAME
The name of the default databasestatic String
DEFAULT_POOL_NAME
The name of the default pool
-
Constructor Summary
Constructors Constructor Description MongoClient(io.vertx.ext.mongo.MongoClient delegate)
MongoClient(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ReadStream<io.vertx.core.json.JsonObject>
aggregate(String collection, io.vertx.core.json.JsonArray pipeline)
ReadStream<io.vertx.core.json.JsonObject>
aggregateWithOptions(String collection, io.vertx.core.json.JsonArray pipeline, io.vertx.ext.mongo.AggregateOptions options)
io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientBulkWriteResult>
bulkWrite(String collection, List<io.vertx.ext.mongo.BulkOperation> operations)
Execute a bulk operation.io.vertx.ext.mongo.MongoClientBulkWriteResult
bulkWriteAndAwait(String collection, List<io.vertx.ext.mongo.BulkOperation> operations)
Blocking variant ofbulkWrite(String,List)
.MongoClient
bulkWriteAndForget(String collection, List<io.vertx.ext.mongo.BulkOperation> operations)
Variant ofbulkWrite(String,List)
that ignores the result of the operation.io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientBulkWriteResult>
bulkWriteWithOptions(String collection, List<io.vertx.ext.mongo.BulkOperation> operations, io.vertx.ext.mongo.BulkWriteOptions bulkWriteOptions)
Execute a bulk operation with the specified write options.io.vertx.ext.mongo.MongoClientBulkWriteResult
bulkWriteWithOptionsAndAwait(String collection, List<io.vertx.ext.mongo.BulkOperation> operations, io.vertx.ext.mongo.BulkWriteOptions bulkWriteOptions)
Blocking variant ofbulkWriteWithOptions(String,List,BulkWriteOptions)
.MongoClient
bulkWriteWithOptionsAndForget(String collection, List<io.vertx.ext.mongo.BulkOperation> operations, io.vertx.ext.mongo.BulkWriteOptions bulkWriteOptions)
Variant ofbulkWriteWithOptions(String,List,BulkWriteOptions)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>
close()
Close the client and release its resourcesVoid
closeAndAwait()
Blocking variant ofclose()
.void
closeAndForget()
Variant ofclose()
that ignores the result of the operation.io.smallrye.mutiny.Uni<Long>
count(String collection, io.vertx.core.json.JsonObject query)
Count matching documents in a collection.Long
countAndAwait(String collection, io.vertx.core.json.JsonObject query)
Blocking variant ofcount(String,JsonObject)
.MongoClient
countAndForget(String collection, io.vertx.core.json.JsonObject query)
Variant ofcount(String,JsonObject)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Long>
countWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.CountOptions countOptions)
Count matching documents in a collection.Long
countWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.CountOptions countOptions)
Blocking variant ofcountWithOptions(String,JsonObject,CountOptions)
.MongoClient
countWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.CountOptions countOptions)
Variant ofcountWithOptions(String,JsonObject,CountOptions)
that ignores the result of the operation.static MongoClient
create(Vertx vertx, io.vertx.core.json.JsonObject config)
io.smallrye.mutiny.Uni<Void>
createCollection(String collectionName)
Create a new collectionVoid
createCollectionAndAwait(String collectionName)
Blocking variant ofcreateCollection(String)
.MongoClient
createCollectionAndForget(String collectionName)
Variant ofcreateCollection(String)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>
createCollectionWithOptions(String collectionName, io.vertx.ext.mongo.CreateCollectionOptions collectionOptions)
Create a new collection with optionsVoid
createCollectionWithOptionsAndAwait(String collectionName, io.vertx.ext.mongo.CreateCollectionOptions collectionOptions)
Blocking variant ofcreateCollectionWithOptions(String,CreateCollectionOptions)
.MongoClient
createCollectionWithOptionsAndForget(String collectionName, io.vertx.ext.mongo.CreateCollectionOptions collectionOptions)
Variant ofcreateCollectionWithOptions(String,CreateCollectionOptions)
that ignores the result of the operation.io.smallrye.mutiny.Uni<MongoGridFsClient>
createDefaultGridFsBucketService()
Creates aMongoGridFsClient
used to interact with Mongo GridFS.MongoGridFsClient
createDefaultGridFsBucketServiceAndAwait()
Blocking variant ofcreateDefaultGridFsBucketService()
.MongoClient
createDefaultGridFsBucketServiceAndForget()
Variant ofcreateDefaultGridFsBucketService()
that ignores the result of the operation.io.smallrye.mutiny.Uni<MongoGridFsClient>
createGridFsBucketService(String bucketName)
Creates aMongoGridFsClient
used to interact with Mongo GridFS.MongoGridFsClient
createGridFsBucketServiceAndAwait(String bucketName)
Blocking variant ofcreateGridFsBucketService(String)
.MongoClient
createGridFsBucketServiceAndForget(String bucketName)
Variant ofcreateGridFsBucketService(String)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>
createIndex(String collection, io.vertx.core.json.JsonObject key)
Creates an index.Void
createIndexAndAwait(String collection, io.vertx.core.json.JsonObject key)
Blocking variant ofcreateIndex(String,JsonObject)
.MongoClient
createIndexAndForget(String collection, io.vertx.core.json.JsonObject key)
Variant ofcreateIndex(String,JsonObject)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>
createIndexes(String collection, List<io.vertx.ext.mongo.IndexModel> indexes)
creates an indexesVoid
createIndexesAndAwait(String collection, List<io.vertx.ext.mongo.IndexModel> indexes)
Blocking variant ofcreateIndexes(String,List)
.MongoClient
createIndexesAndForget(String collection, List<io.vertx.ext.mongo.IndexModel> indexes)
Variant ofcreateIndexes(String,List)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>
createIndexWithOptions(String collection, io.vertx.core.json.JsonObject key, io.vertx.ext.mongo.IndexOptions options)
Creates an index.Void
createIndexWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject key, io.vertx.ext.mongo.IndexOptions options)
Blocking variant ofcreateIndexWithOptions(String,JsonObject,IndexOptions)
.MongoClient
createIndexWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject key, io.vertx.ext.mongo.IndexOptions options)
Variant ofcreateIndexWithOptions(String,JsonObject,IndexOptions)
that ignores the result of the operation.static MongoClient
createShared(Vertx vertx, io.vertx.core.json.JsonObject config)
static MongoClient
createShared(Vertx vertx, io.vertx.core.json.JsonObject config, String dataSourceName)
io.smallrye.mutiny.Uni<io.vertx.core.json.JsonArray>
distinct(String collection, String fieldName, String resultClassname)
Gets the distinct values of the specified field name.io.smallrye.mutiny.Uni<io.vertx.core.json.JsonArray>
distinct(String collection, String fieldName, String resultClassname, io.vertx.ext.mongo.DistinctOptions distinctOptions)
Gets the distinct values of the specified field name.io.vertx.core.json.JsonArray
distinctAndAwait(String collection, String fieldName, String resultClassname)
Blocking variant ofdistinct(String,String,String)
.io.vertx.core.json.JsonArray
distinctAndAwait(String collection, String fieldName, String resultClassname, io.vertx.ext.mongo.DistinctOptions distinctOptions)
Blocking variant ofdistinct(String,String,String,DistinctOptions)
.MongoClient
distinctAndForget(String collection, String fieldName, String resultClassname)
Variant ofdistinct(String,String,String)
that ignores the result of the operation.MongoClient
distinctAndForget(String collection, String fieldName, String resultClassname, io.vertx.ext.mongo.DistinctOptions distinctOptions)
Variant ofdistinct(String,String,String,DistinctOptions)
that ignores the result of the operation.ReadStream<io.vertx.core.json.JsonObject>
distinctBatch(String collection, String fieldName, String resultClassname)
ReadStream<io.vertx.core.json.JsonObject>
distinctBatch(String collection, String fieldName, String resultClassname, io.vertx.ext.mongo.DistinctOptions distinctOptions)
ReadStream<io.vertx.core.json.JsonObject>
distinctBatchWithQuery(String collection, String fieldName, String resultClassname, io.vertx.core.json.JsonObject query)
ReadStream<io.vertx.core.json.JsonObject>
distinctBatchWithQuery(String collection, String fieldName, String resultClassname, io.vertx.core.json.JsonObject query, int batchSize)
ReadStream<io.vertx.core.json.JsonObject>
distinctBatchWithQuery(String collection, String fieldName, String resultClassname, io.vertx.core.json.JsonObject query, int batchSize, io.vertx.ext.mongo.DistinctOptions distinctOptions)
ReadStream<io.vertx.core.json.JsonObject>
distinctBatchWithQuery(String collection, String fieldName, String resultClassname, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.DistinctOptions distinctOptions)
io.smallrye.mutiny.Uni<io.vertx.core.json.JsonArray>
distinctWithQuery(String collection, String fieldName, String resultClassname, io.vertx.core.json.JsonObject query)
Gets the distinct values of the specified field name filtered by specified query.io.smallrye.mutiny.Uni<io.vertx.core.json.JsonArray>
distinctWithQuery(String collection, String fieldName, String resultClassname, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.DistinctOptions distinctOptions)
Gets the distinct values of the specified field name filtered by specified query.io.vertx.core.json.JsonArray
distinctWithQueryAndAwait(String collection, String fieldName, String resultClassname, io.vertx.core.json.JsonObject query)
Blocking variant ofdistinctWithQuery(String,String,String,JsonObject)
.io.vertx.core.json.JsonArray
distinctWithQueryAndAwait(String collection, String fieldName, String resultClassname, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.DistinctOptions distinctOptions)
Blocking variant ofdistinctWithQuery(String,String,String,JsonObject,DistinctOptions)
.MongoClient
distinctWithQueryAndForget(String collection, String fieldName, String resultClassname, io.vertx.core.json.JsonObject query)
Variant ofdistinctWithQuery(String,String,String,JsonObject)
that ignores the result of the operation.MongoClient
distinctWithQueryAndForget(String collection, String fieldName, String resultClassname, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.DistinctOptions distinctOptions)
Variant ofdistinctWithQuery(String,String,String,JsonObject,DistinctOptions)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>
dropCollection(String collection)
Drop a collectionVoid
dropCollectionAndAwait(String collection)
Blocking variant ofdropCollection(String)
.MongoClient
dropCollectionAndForget(String collection)
Variant ofdropCollection(String)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>
dropIndex(String collection, String indexName)
Drops the index given its name.Void
dropIndexAndAwait(String collection, String indexName)
Blocking variant ofdropIndex(String,String)
.MongoClient
dropIndexAndForget(String collection, String indexName)
Variant ofdropIndex(String,String)
that ignores the result of the operation.boolean
equals(Object o)
io.smallrye.mutiny.Uni<List<io.vertx.core.json.JsonObject>>
find(String collection, io.vertx.core.json.JsonObject query)
Find matching documents in the specified collectionList<io.vertx.core.json.JsonObject>
findAndAwait(String collection, io.vertx.core.json.JsonObject query)
Blocking variant offind(String,JsonObject)
.MongoClient
findAndForget(String collection, io.vertx.core.json.JsonObject query)
Variant offind(String,JsonObject)
that ignores the result of the operation.ReadStream<io.vertx.core.json.JsonObject>
findBatch(String collection, io.vertx.core.json.JsonObject query)
ReadStream<io.vertx.core.json.JsonObject>
findBatchWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.FindOptions options)
io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject>
findOne(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject fields)
Find a single matching document in the specified collectionio.vertx.core.json.JsonObject
findOneAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject fields)
Blocking variant offindOne(String,JsonObject,JsonObject)
.io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject>
findOneAndDelete(String collection, io.vertx.core.json.JsonObject query)
Find a single matching document in the specified collection and delete it.io.vertx.core.json.JsonObject
findOneAndDeleteAndAwait(String collection, io.vertx.core.json.JsonObject query)
Blocking variant offindOneAndDelete(String,JsonObject)
.MongoClient
findOneAndDeleteAndForget(String collection, io.vertx.core.json.JsonObject query)
Variant offindOneAndDelete(String,JsonObject)
that ignores the result of the operation.io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject>
findOneAndDeleteWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.FindOptions findOptions)
Find a single matching document in the specified collection and delete it.io.vertx.core.json.JsonObject
findOneAndDeleteWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.FindOptions findOptions)
Blocking variant offindOneAndDeleteWithOptions(String,JsonObject,FindOptions)
.MongoClient
findOneAndDeleteWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.FindOptions findOptions)
Variant offindOneAndDeleteWithOptions(String,JsonObject,FindOptions)
that ignores the result of the operation.MongoClient
findOneAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject fields)
Variant offindOne(String,JsonObject,JsonObject)
that ignores the result of the operation.io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject>
findOneAndReplace(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace)
Find a single matching document in the specified collection and replace it.io.vertx.core.json.JsonObject
findOneAndReplaceAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace)
Blocking variant offindOneAndReplace(String,JsonObject,JsonObject)
.MongoClient
findOneAndReplaceAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace)
Variant offindOneAndReplace(String,JsonObject,JsonObject)
that ignores the result of the operation.io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject>
findOneAndReplaceWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace, io.vertx.ext.mongo.FindOptions findOptions, io.vertx.ext.mongo.UpdateOptions updateOptions)
Find a single matching document in the specified collection and replace it.io.vertx.core.json.JsonObject
findOneAndReplaceWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace, io.vertx.ext.mongo.FindOptions findOptions, io.vertx.ext.mongo.UpdateOptions updateOptions)
Blocking variant offindOneAndReplaceWithOptions(String,JsonObject,JsonObject,FindOptions,UpdateOptions)
.MongoClient
findOneAndReplaceWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace, io.vertx.ext.mongo.FindOptions findOptions, io.vertx.ext.mongo.UpdateOptions updateOptions)
Variant offindOneAndReplaceWithOptions(String,JsonObject,JsonObject,FindOptions,UpdateOptions)
that ignores the result of the operation.io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject>
findOneAndUpdate(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update)
Find a single matching document in the specified collection and update it.io.vertx.core.json.JsonObject
findOneAndUpdateAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update)
Blocking variant offindOneAndUpdate(String,JsonObject,JsonObject)
.MongoClient
findOneAndUpdateAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update)
Variant offindOneAndUpdate(String,JsonObject,JsonObject)
that ignores the result of the operation.io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject>
findOneAndUpdateWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update, io.vertx.ext.mongo.FindOptions findOptions, io.vertx.ext.mongo.UpdateOptions updateOptions)
Find a single matching document in the specified collection and update it.io.vertx.core.json.JsonObject
findOneAndUpdateWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update, io.vertx.ext.mongo.FindOptions findOptions, io.vertx.ext.mongo.UpdateOptions updateOptions)
Blocking variant offindOneAndUpdateWithOptions(String,JsonObject,JsonObject,FindOptions,UpdateOptions)
.MongoClient
findOneAndUpdateWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update, io.vertx.ext.mongo.FindOptions findOptions, io.vertx.ext.mongo.UpdateOptions updateOptions)
Variant offindOneAndUpdateWithOptions(String,JsonObject,JsonObject,FindOptions,UpdateOptions)
that ignores the result of the operation.io.smallrye.mutiny.Uni<List<io.vertx.core.json.JsonObject>>
findWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.FindOptions options)
Find matching documents in the specified collection, specifying optionsList<io.vertx.core.json.JsonObject>
findWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.FindOptions options)
Blocking variant offindWithOptions(String,JsonObject,FindOptions)
.MongoClient
findWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.FindOptions options)
Variant offindWithOptions(String,JsonObject,FindOptions)
that ignores the result of the operation.io.smallrye.mutiny.Uni<List<String>>
getCollections()
Get a list of all collections in the database.List<String>
getCollectionsAndAwait()
Blocking variant ofgetCollections()
.MongoClient
getCollectionsAndForget()
Variant ofgetCollections()
that ignores the result of the operation.io.vertx.ext.mongo.MongoClient
getDelegate()
int
hashCode()
io.smallrye.mutiny.Uni<String>
insert(String collection, io.vertx.core.json.JsonObject document)
Insert a document in the specified collectionString
insertAndAwait(String collection, io.vertx.core.json.JsonObject document)
Blocking variant ofinsert(String,JsonObject)
.MongoClient
insertAndForget(String collection, io.vertx.core.json.JsonObject document)
Variant ofinsert(String,JsonObject)
that ignores the result of the operation.io.smallrye.mutiny.Uni<String>
insertWithOptions(String collection, io.vertx.core.json.JsonObject document, io.vertx.ext.mongo.WriteOption writeOption)
Insert a document in the specified collection with the specified write optionString
insertWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject document, io.vertx.ext.mongo.WriteOption writeOption)
Blocking variant ofinsertWithOptions(String,JsonObject,WriteOption)
.MongoClient
insertWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject document, io.vertx.ext.mongo.WriteOption writeOption)
Variant ofinsertWithOptions(String,JsonObject,WriteOption)
that ignores the result of the operation.io.smallrye.mutiny.Uni<io.vertx.core.json.JsonArray>
listIndexes(String collection)
Get all the indexes in this collection.io.vertx.core.json.JsonArray
listIndexesAndAwait(String collection)
Blocking variant oflistIndexes(String)
.MongoClient
listIndexesAndForget(String collection)
Variant oflistIndexes(String)
that ignores the result of the operation.static MongoClient
newInstance(io.vertx.ext.mongo.MongoClient arg)
io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientDeleteResult>
removeDocument(String collection, io.vertx.core.json.JsonObject query)
Remove a single matching document from a collection and return the handler withMongoClientDeleteResult
resultio.vertx.ext.mongo.MongoClientDeleteResult
removeDocumentAndAwait(String collection, io.vertx.core.json.JsonObject query)
Blocking variant ofremoveDocument(String,JsonObject)
.MongoClient
removeDocumentAndForget(String collection, io.vertx.core.json.JsonObject query)
Variant ofremoveDocument(String,JsonObject)
that ignores the result of the operation.io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientDeleteResult>
removeDocuments(String collection, io.vertx.core.json.JsonObject query)
Remove matching documents from a collection and return the handler withMongoClientDeleteResult
resultio.vertx.ext.mongo.MongoClientDeleteResult
removeDocumentsAndAwait(String collection, io.vertx.core.json.JsonObject query)
Blocking variant ofremoveDocuments(String,JsonObject)
.MongoClient
removeDocumentsAndForget(String collection, io.vertx.core.json.JsonObject query)
Variant ofremoveDocuments(String,JsonObject)
that ignores the result of the operation.io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientDeleteResult>
removeDocumentsWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.WriteOption writeOption)
Remove matching documents from a collection with the specified write option and return the handler withMongoClientDeleteResult
resultio.vertx.ext.mongo.MongoClientDeleteResult
removeDocumentsWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.WriteOption writeOption)
Blocking variant ofremoveDocumentsWithOptions(String,JsonObject,WriteOption)
.MongoClient
removeDocumentsWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.WriteOption writeOption)
Variant ofremoveDocumentsWithOptions(String,JsonObject,WriteOption)
that ignores the result of the operation.io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientDeleteResult>
removeDocumentWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.WriteOption writeOption)
Remove a single matching document from a collection with the specified write option and return the handler withMongoClientDeleteResult
resultio.vertx.ext.mongo.MongoClientDeleteResult
removeDocumentWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.WriteOption writeOption)
Blocking variant ofremoveDocumentWithOptions(String,JsonObject,WriteOption)
.MongoClient
removeDocumentWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.WriteOption writeOption)
Variant ofremoveDocumentWithOptions(String,JsonObject,WriteOption)
that ignores the result of the operation.io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientUpdateResult>
replaceDocuments(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace)
Replace matching documents in the specified collection and return the handler withMongoClientUpdateResult
resultio.vertx.ext.mongo.MongoClientUpdateResult
replaceDocumentsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace)
Blocking variant ofreplaceDocuments(String,JsonObject,JsonObject)
.MongoClient
replaceDocumentsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace)
Variant ofreplaceDocuments(String,JsonObject,JsonObject)
that ignores the result of the operation.io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientUpdateResult>
replaceDocumentsWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace, io.vertx.ext.mongo.UpdateOptions options)
Replace matching documents in the specified collection, specifying options and return the handler withMongoClientUpdateResult
resultio.vertx.ext.mongo.MongoClientUpdateResult
replaceDocumentsWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace, io.vertx.ext.mongo.UpdateOptions options)
Blocking variant ofreplaceDocumentsWithOptions(String,JsonObject,JsonObject,UpdateOptions)
.MongoClient
replaceDocumentsWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace, io.vertx.ext.mongo.UpdateOptions options)
Variant ofreplaceDocumentsWithOptions(String,JsonObject,JsonObject,UpdateOptions)
that ignores the result of the operation.io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject>
runCommand(String commandName, io.vertx.core.json.JsonObject command)
Run an arbitrary MongoDB command.io.vertx.core.json.JsonObject
runCommandAndAwait(String commandName, io.vertx.core.json.JsonObject command)
Blocking variant ofrunCommand(String,JsonObject)
.MongoClient
runCommandAndForget(String commandName, io.vertx.core.json.JsonObject command)
Variant ofrunCommand(String,JsonObject)
that ignores the result of the operation.io.smallrye.mutiny.Uni<String>
save(String collection, io.vertx.core.json.JsonObject document)
Save a document in the specified collectionString
saveAndAwait(String collection, io.vertx.core.json.JsonObject document)
Blocking variant ofsave(String,JsonObject)
.MongoClient
saveAndForget(String collection, io.vertx.core.json.JsonObject document)
Variant ofsave(String,JsonObject)
that ignores the result of the operation.io.smallrye.mutiny.Uni<String>
saveWithOptions(String collection, io.vertx.core.json.JsonObject document, io.vertx.ext.mongo.WriteOption writeOption)
Save a document in the specified collection with the specified write optionString
saveWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject document, io.vertx.ext.mongo.WriteOption writeOption)
Blocking variant ofsaveWithOptions(String,JsonObject,WriteOption)
.MongoClient
saveWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject document, io.vertx.ext.mongo.WriteOption writeOption)
Variant ofsaveWithOptions(String,JsonObject,WriteOption)
that ignores the result of the operation.String
toString()
io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientUpdateResult>
updateCollection(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonArray update)
Use an aggregation pipeline to update documents in the specified collection and return the handler withMongoClientUpdateResult
resultio.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientUpdateResult>
updateCollection(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update)
Update matching documents in the specified collection and return the handler withMongoClientUpdateResult
resultio.vertx.ext.mongo.MongoClientUpdateResult
updateCollectionAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonArray update)
Blocking variant ofupdateCollection(String,JsonObject,JsonArray)
.io.vertx.ext.mongo.MongoClientUpdateResult
updateCollectionAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update)
Blocking variant ofupdateCollection(String,JsonObject,JsonObject)
.MongoClient
updateCollectionAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonArray update)
Variant ofupdateCollection(String,JsonObject,JsonArray)
that ignores the result of the operation.MongoClient
updateCollectionAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update)
Variant ofupdateCollection(String,JsonObject,JsonObject)
that ignores the result of the operation.io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientUpdateResult>
updateCollectionWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonArray update, io.vertx.ext.mongo.UpdateOptions options)
Use an aggregation pipeline to update documents in the specified collection, specifying options and return the handler withMongoClientUpdateResult
resultio.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientUpdateResult>
updateCollectionWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update, io.vertx.ext.mongo.UpdateOptions options)
Update matching documents in the specified collection, specifying options and return the handler withMongoClientUpdateResult
resultio.vertx.ext.mongo.MongoClientUpdateResult
updateCollectionWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonArray update, io.vertx.ext.mongo.UpdateOptions options)
Blocking variant ofupdateCollectionWithOptions(String,JsonObject,JsonArray,UpdateOptions)
.io.vertx.ext.mongo.MongoClientUpdateResult
updateCollectionWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update, io.vertx.ext.mongo.UpdateOptions options)
Blocking variant ofupdateCollectionWithOptions(String,JsonObject,JsonObject,UpdateOptions)
.MongoClient
updateCollectionWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonArray update, io.vertx.ext.mongo.UpdateOptions options)
Variant ofupdateCollectionWithOptions(String,JsonObject,JsonArray,UpdateOptions)
that ignores the result of the operation.MongoClient
updateCollectionWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update, io.vertx.ext.mongo.UpdateOptions options)
Variant ofupdateCollectionWithOptions(String,JsonObject,JsonObject,UpdateOptions)
that ignores the result of the operation.ReadStream<com.mongodb.client.model.changestream.ChangeStreamDocument<io.vertx.core.json.JsonObject>>
watch(String collection, io.vertx.core.json.JsonArray pipeline, boolean withUpdatedDoc, int batchSize)
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<MongoClient> __TYPE_ARG
-
DEFAULT_POOL_NAME
public static final String DEFAULT_POOL_NAME
The name of the default pool- See Also:
- Constant Field Values
-
DEFAULT_DB_NAME
public static final String DEFAULT_DB_NAME
The name of the default database- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MongoClient
public MongoClient(io.vertx.ext.mongo.MongoClient delegate)
-
MongoClient
public MongoClient(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.ext.mongo.MongoClient getDelegate()
-
create
public static MongoClient create(Vertx vertx, io.vertx.core.json.JsonObject config)
- Parameters:
vertx
- the Vert.x instanceconfig
- the configuration- Returns:
- the client
-
createShared
public static MongoClient createShared(Vertx vertx, io.vertx.core.json.JsonObject config, String dataSourceName)
- Parameters:
vertx
- the Vert.x instanceconfig
- the configurationdataSourceName
- the data source name- Returns:
- the client
-
createShared
public static MongoClient createShared(Vertx vertx, io.vertx.core.json.JsonObject config)
- Parameters:
vertx
- the Vert.x instanceconfig
- the configuration- Returns:
- the client
-
save
@CheckReturnValue public io.smallrye.mutiny.Uni<String> save(String collection, io.vertx.core.json.JsonObject document)
Save a document in the specified collectionThis operation might change _id field of document parameter
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectiondocument
- the document- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
saveAndAwait
public String saveAndAwait(String collection, io.vertx.core.json.JsonObject document)
Blocking variant ofsave(String,JsonObject)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectiondocument
- the document- Returns:
- the String instance produced by the operation.
-
saveAndForget
public MongoClient saveAndForget(String collection, io.vertx.core.json.JsonObject document)
Variant ofsave(String,JsonObject)
that ignores the result of the operation.This method subscribes on the result of
save(String,JsonObject)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromsave(String,JsonObject)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectiondocument
- the document- Returns:
- the instance of MongoClient to chain method calls.
-
saveWithOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<String> saveWithOptions(String collection, io.vertx.core.json.JsonObject document, io.vertx.ext.mongo.WriteOption writeOption)
Save a document in the specified collection with the specified write optionThis operation might change _id field of document parameter
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectiondocument
- the documentwriteOption
- the write option to use- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
saveWithOptionsAndAwait
public String saveWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject document, io.vertx.ext.mongo.WriteOption writeOption)
Blocking variant ofsaveWithOptions(String,JsonObject,WriteOption)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectiondocument
- the documentwriteOption
- the write option to use- Returns:
- the String instance produced by the operation.
-
saveWithOptionsAndForget
public MongoClient saveWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject document, io.vertx.ext.mongo.WriteOption writeOption)
Variant ofsaveWithOptions(String,JsonObject,WriteOption)
that ignores the result of the operation.This method subscribes on the result of
saveWithOptions(String,JsonObject,WriteOption)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromsaveWithOptions(String,JsonObject,WriteOption)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectiondocument
- the documentwriteOption
- the write option to use- Returns:
- the instance of MongoClient to chain method calls.
-
insert
@CheckReturnValue public io.smallrye.mutiny.Uni<String> insert(String collection, io.vertx.core.json.JsonObject document)
Insert a document in the specified collectionThis operation might change _id field of document parameter
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectiondocument
- the document- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
insertAndAwait
public String insertAndAwait(String collection, io.vertx.core.json.JsonObject document)
Blocking variant ofinsert(String,JsonObject)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectiondocument
- the document- Returns:
- the String instance produced by the operation.
-
insertAndForget
public MongoClient insertAndForget(String collection, io.vertx.core.json.JsonObject document)
Variant ofinsert(String,JsonObject)
that ignores the result of the operation.This method subscribes on the result of
insert(String,JsonObject)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation frominsert(String,JsonObject)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectiondocument
- the document- Returns:
- the instance of MongoClient to chain method calls.
-
insertWithOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<String> insertWithOptions(String collection, io.vertx.core.json.JsonObject document, io.vertx.ext.mongo.WriteOption writeOption)
Insert a document in the specified collection with the specified write optionThis operation might change _id field of document parameter
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectiondocument
- the documentwriteOption
- the write option to use- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
insertWithOptionsAndAwait
public String insertWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject document, io.vertx.ext.mongo.WriteOption writeOption)
Blocking variant ofinsertWithOptions(String,JsonObject,WriteOption)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectiondocument
- the documentwriteOption
- the write option to use- Returns:
- the String instance produced by the operation.
-
insertWithOptionsAndForget
public MongoClient insertWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject document, io.vertx.ext.mongo.WriteOption writeOption)
Variant ofinsertWithOptions(String,JsonObject,WriteOption)
that ignores the result of the operation.This method subscribes on the result of
insertWithOptions(String,JsonObject,WriteOption)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation frominsertWithOptions(String,JsonObject,WriteOption)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectiondocument
- the documentwriteOption
- the write option to use- Returns:
- the instance of MongoClient to chain method calls.
-
updateCollection
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientUpdateResult> updateCollection(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update)
Update matching documents in the specified collection and return the handler withMongoClientUpdateResult
resultUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionquery
- query used to match the documentsupdate
- used to describe how the documents will be updated- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
updateCollectionAndAwait
public io.vertx.ext.mongo.MongoClientUpdateResult updateCollectionAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update)
Blocking variant ofupdateCollection(String,JsonObject,JsonObject)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionquery
- query used to match the documentsupdate
- used to describe how the documents will be updated- Returns:
- the MongoClientUpdateResult instance produced by the operation.
-
updateCollectionAndForget
public MongoClient updateCollectionAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update)
Variant ofupdateCollection(String,JsonObject,JsonObject)
that ignores the result of the operation.This method subscribes on the result of
updateCollection(String,JsonObject,JsonObject)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromupdateCollection(String,JsonObject,JsonObject)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionquery
- query used to match the documentsupdate
- used to describe how the documents will be updated- Returns:
- the instance of MongoClient to chain method calls.
-
updateCollection
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientUpdateResult> updateCollection(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonArray update)
Use an aggregation pipeline to update documents in the specified collection and return the handler withMongoClientUpdateResult
resultUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionquery
- query used to match the documentsupdate
- used to describe how the documents will be updated- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
updateCollectionAndAwait
public io.vertx.ext.mongo.MongoClientUpdateResult updateCollectionAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonArray update)
Blocking variant ofupdateCollection(String,JsonObject,JsonArray)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionquery
- query used to match the documentsupdate
- used to describe how the documents will be updated- Returns:
- the MongoClientUpdateResult instance produced by the operation.
-
updateCollectionAndForget
public MongoClient updateCollectionAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonArray update)
Variant ofupdateCollection(String,JsonObject,JsonArray)
that ignores the result of the operation.This method subscribes on the result of
updateCollection(String,JsonObject,JsonArray)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromupdateCollection(String,JsonObject,JsonArray)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionquery
- query used to match the documentsupdate
- used to describe how the documents will be updated- Returns:
- the instance of MongoClient to chain method calls.
-
updateCollectionWithOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientUpdateResult> updateCollectionWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update, io.vertx.ext.mongo.UpdateOptions options)
Update matching documents in the specified collection, specifying options and return the handler withMongoClientUpdateResult
resultUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionquery
- query used to match the documentsupdate
- used to describe how the documents will be updatedoptions
- options to configure the update- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
updateCollectionWithOptionsAndAwait
public io.vertx.ext.mongo.MongoClientUpdateResult updateCollectionWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update, io.vertx.ext.mongo.UpdateOptions options)
Blocking variant ofupdateCollectionWithOptions(String,JsonObject,JsonObject,UpdateOptions)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionquery
- query used to match the documentsupdate
- used to describe how the documents will be updatedoptions
- options to configure the update- Returns:
- the MongoClientUpdateResult instance produced by the operation.
-
updateCollectionWithOptionsAndForget
public MongoClient updateCollectionWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update, io.vertx.ext.mongo.UpdateOptions options)
Variant ofupdateCollectionWithOptions(String,JsonObject,JsonObject,UpdateOptions)
that ignores the result of the operation.This method subscribes on the result of
updateCollectionWithOptions(String,JsonObject,JsonObject,UpdateOptions)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromupdateCollectionWithOptions(String,JsonObject,JsonObject,UpdateOptions)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionquery
- query used to match the documentsupdate
- used to describe how the documents will be updatedoptions
- options to configure the update- Returns:
- the instance of MongoClient to chain method calls.
-
updateCollectionWithOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientUpdateResult> updateCollectionWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonArray update, io.vertx.ext.mongo.UpdateOptions options)
Use an aggregation pipeline to update documents in the specified collection, specifying options and return the handler withMongoClientUpdateResult
resultUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionquery
- query used to match the documentsupdate
- aggregation pipeline used to describe how documents will be updatedoptions
- options to configure the update- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
updateCollectionWithOptionsAndAwait
public io.vertx.ext.mongo.MongoClientUpdateResult updateCollectionWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonArray update, io.vertx.ext.mongo.UpdateOptions options)
Blocking variant ofupdateCollectionWithOptions(String,JsonObject,JsonArray,UpdateOptions)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionquery
- query used to match the documentsupdate
- aggregation pipeline used to describe how documents will be updatedoptions
- options to configure the update- Returns:
- the MongoClientUpdateResult instance produced by the operation.
-
updateCollectionWithOptionsAndForget
public MongoClient updateCollectionWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonArray update, io.vertx.ext.mongo.UpdateOptions options)
Variant ofupdateCollectionWithOptions(String,JsonObject,JsonArray,UpdateOptions)
that ignores the result of the operation.This method subscribes on the result of
updateCollectionWithOptions(String,JsonObject,JsonArray,UpdateOptions)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromupdateCollectionWithOptions(String,JsonObject,JsonArray,UpdateOptions)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionquery
- query used to match the documentsupdate
- aggregation pipeline used to describe how documents will be updatedoptions
- options to configure the update- Returns:
- the instance of MongoClient to chain method calls.
-
replaceDocuments
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientUpdateResult> replaceDocuments(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace)
Replace matching documents in the specified collection and return the handler withMongoClientUpdateResult
resultUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionquery
- query used to match the documentsreplace
- all matching documents will be replaced with this- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
replaceDocumentsAndAwait
public io.vertx.ext.mongo.MongoClientUpdateResult replaceDocumentsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace)
Blocking variant ofreplaceDocuments(String,JsonObject,JsonObject)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionquery
- query used to match the documentsreplace
- all matching documents will be replaced with this- Returns:
- the MongoClientUpdateResult instance produced by the operation.
-
replaceDocumentsAndForget
public MongoClient replaceDocumentsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace)
Variant ofreplaceDocuments(String,JsonObject,JsonObject)
that ignores the result of the operation.This method subscribes on the result of
replaceDocuments(String,JsonObject,JsonObject)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromreplaceDocuments(String,JsonObject,JsonObject)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionquery
- query used to match the documentsreplace
- all matching documents will be replaced with this- Returns:
- the instance of MongoClient to chain method calls.
-
replaceDocumentsWithOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientUpdateResult> replaceDocumentsWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace, io.vertx.ext.mongo.UpdateOptions options)
Replace matching documents in the specified collection, specifying options and return the handler withMongoClientUpdateResult
resultUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionquery
- query used to match the documentsreplace
- all matching documents will be replaced with thisoptions
- options to configure the replace- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
replaceDocumentsWithOptionsAndAwait
public io.vertx.ext.mongo.MongoClientUpdateResult replaceDocumentsWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace, io.vertx.ext.mongo.UpdateOptions options)
Blocking variant ofreplaceDocumentsWithOptions(String,JsonObject,JsonObject,UpdateOptions)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionquery
- query used to match the documentsreplace
- all matching documents will be replaced with thisoptions
- options to configure the replace- Returns:
- the MongoClientUpdateResult instance produced by the operation.
-
replaceDocumentsWithOptionsAndForget
public MongoClient replaceDocumentsWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace, io.vertx.ext.mongo.UpdateOptions options)
Variant ofreplaceDocumentsWithOptions(String,JsonObject,JsonObject,UpdateOptions)
that ignores the result of the operation.This method subscribes on the result of
replaceDocumentsWithOptions(String,JsonObject,JsonObject,UpdateOptions)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromreplaceDocumentsWithOptions(String,JsonObject,JsonObject,UpdateOptions)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionquery
- query used to match the documentsreplace
- all matching documents will be replaced with thisoptions
- options to configure the replace- Returns:
- the instance of MongoClient to chain method calls.
-
bulkWrite
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientBulkWriteResult> bulkWrite(String collection, List<io.vertx.ext.mongo.BulkOperation> operations)
Execute a bulk operation. Can insert, update, replace, and/or delete multiple documents with one request.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionoperations
- the operations to execute- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
bulkWriteAndAwait
public io.vertx.ext.mongo.MongoClientBulkWriteResult bulkWriteAndAwait(String collection, List<io.vertx.ext.mongo.BulkOperation> operations)
Blocking variant ofbulkWrite(String,List)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionoperations
- the operations to execute- Returns:
- the MongoClientBulkWriteResult instance produced by the operation.
-
bulkWriteAndForget
public MongoClient bulkWriteAndForget(String collection, List<io.vertx.ext.mongo.BulkOperation> operations)
Variant ofbulkWrite(String,List)
that ignores the result of the operation.This method subscribes on the result of
bulkWrite(String,List)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation frombulkWrite(String,List)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionoperations
- the operations to execute- Returns:
- the instance of MongoClient to chain method calls.
-
bulkWriteWithOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientBulkWriteResult> bulkWriteWithOptions(String collection, List<io.vertx.ext.mongo.BulkOperation> operations, io.vertx.ext.mongo.BulkWriteOptions bulkWriteOptions)
Execute a bulk operation with the specified write options. Can insert, update, replace, and/or delete multiple documents with one request.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionoperations
- the operations to executebulkWriteOptions
- the write options- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
bulkWriteWithOptionsAndAwait
public io.vertx.ext.mongo.MongoClientBulkWriteResult bulkWriteWithOptionsAndAwait(String collection, List<io.vertx.ext.mongo.BulkOperation> operations, io.vertx.ext.mongo.BulkWriteOptions bulkWriteOptions)
Blocking variant ofbulkWriteWithOptions(String,List,BulkWriteOptions)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionoperations
- the operations to executebulkWriteOptions
- the write options- Returns:
- the MongoClientBulkWriteResult instance produced by the operation.
-
bulkWriteWithOptionsAndForget
public MongoClient bulkWriteWithOptionsAndForget(String collection, List<io.vertx.ext.mongo.BulkOperation> operations, io.vertx.ext.mongo.BulkWriteOptions bulkWriteOptions)
Variant ofbulkWriteWithOptions(String,List,BulkWriteOptions)
that ignores the result of the operation.This method subscribes on the result of
bulkWriteWithOptions(String,List,BulkWriteOptions)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation frombulkWriteWithOptions(String,List,BulkWriteOptions)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionoperations
- the operations to executebulkWriteOptions
- the write options- Returns:
- the instance of MongoClient to chain method calls.
-
find
@CheckReturnValue public io.smallrye.mutiny.Uni<List<io.vertx.core.json.JsonObject>> find(String collection, io.vertx.core.json.JsonObject query)
Find matching documents in the specified collectionUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionquery
- query used to match documents- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
findAndAwait
public List<io.vertx.core.json.JsonObject> findAndAwait(String collection, io.vertx.core.json.JsonObject query)
Blocking variant offind(String,JsonObject)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionquery
- query used to match documents- Returns:
- the List
instance produced by the operation.
-
findAndForget
public MongoClient findAndForget(String collection, io.vertx.core.json.JsonObject query)
Variant offind(String,JsonObject)
that ignores the result of the operation.This method subscribes on the result of
find(String,JsonObject)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromfind(String,JsonObject)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionquery
- query used to match documents- Returns:
- the instance of MongoClient to chain method calls.
-
findBatch
public ReadStream<io.vertx.core.json.JsonObject> findBatch(String collection, io.vertx.core.json.JsonObject query)
- Parameters:
collection
- the collectionquery
- query used to match documents- Returns:
- a emitting found documents
-
findWithOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<List<io.vertx.core.json.JsonObject>> findWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.FindOptions options)
Find matching documents in the specified collection, specifying optionsUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionquery
- query used to match documentsoptions
- options to configure the find- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
findWithOptionsAndAwait
public List<io.vertx.core.json.JsonObject> findWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.FindOptions options)
Blocking variant offindWithOptions(String,JsonObject,FindOptions)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionquery
- query used to match documentsoptions
- options to configure the find- Returns:
- the List
instance produced by the operation.
-
findWithOptionsAndForget
public MongoClient findWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.FindOptions options)
Variant offindWithOptions(String,JsonObject,FindOptions)
that ignores the result of the operation.This method subscribes on the result of
findWithOptions(String,JsonObject,FindOptions)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromfindWithOptions(String,JsonObject,FindOptions)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionquery
- query used to match documentsoptions
- options to configure the find- Returns:
- the instance of MongoClient to chain method calls.
-
findBatchWithOptions
public ReadStream<io.vertx.core.json.JsonObject> findBatchWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.FindOptions options)
- Parameters:
collection
- the collectionquery
- query used to match documentsoptions
- options to configure the find- Returns:
- a emitting found documents
-
findOne
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject> findOne(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject fields)
Find a single matching document in the specified collectionThis operation might change _id field of query parameter
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionquery
- the query used to match the documentfields
- the fields- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
findOneAndAwait
public io.vertx.core.json.JsonObject findOneAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject fields)
Blocking variant offindOne(String,JsonObject,JsonObject)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionquery
- the query used to match the documentfields
- the fields- Returns:
- the JsonObject instance produced by the operation.
-
findOneAndForget
public MongoClient findOneAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject fields)
Variant offindOne(String,JsonObject,JsonObject)
that ignores the result of the operation.This method subscribes on the result of
findOne(String,JsonObject,JsonObject)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromfindOne(String,JsonObject,JsonObject)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionquery
- the query used to match the documentfields
- the fields- Returns:
- the instance of MongoClient to chain method calls.
-
findOneAndUpdate
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject> findOneAndUpdate(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update)
Find a single matching document in the specified collection and update it.This operation might change _id field of query parameter
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionquery
- the query used to match the documentupdate
- used to describe how the documents will be updated- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
findOneAndUpdateAndAwait
public io.vertx.core.json.JsonObject findOneAndUpdateAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update)
Blocking variant offindOneAndUpdate(String,JsonObject,JsonObject)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionquery
- the query used to match the documentupdate
- used to describe how the documents will be updated- Returns:
- the JsonObject instance produced by the operation.
-
findOneAndUpdateAndForget
public MongoClient findOneAndUpdateAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update)
Variant offindOneAndUpdate(String,JsonObject,JsonObject)
that ignores the result of the operation.This method subscribes on the result of
findOneAndUpdate(String,JsonObject,JsonObject)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromfindOneAndUpdate(String,JsonObject,JsonObject)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionquery
- the query used to match the documentupdate
- used to describe how the documents will be updated- Returns:
- the instance of MongoClient to chain method calls.
-
findOneAndUpdateWithOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject> findOneAndUpdateWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update, io.vertx.ext.mongo.FindOptions findOptions, io.vertx.ext.mongo.UpdateOptions updateOptions)
Find a single matching document in the specified collection and update it.This operation might change _id field of query parameter
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionquery
- the query used to match the documentupdate
- used to describe how the documents will be updatedfindOptions
- options to configure the findupdateOptions
- options to configure the update- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
findOneAndUpdateWithOptionsAndAwait
public io.vertx.core.json.JsonObject findOneAndUpdateWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update, io.vertx.ext.mongo.FindOptions findOptions, io.vertx.ext.mongo.UpdateOptions updateOptions)
Blocking variant offindOneAndUpdateWithOptions(String,JsonObject,JsonObject,FindOptions,UpdateOptions)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionquery
- the query used to match the documentupdate
- used to describe how the documents will be updatedfindOptions
- options to configure the findupdateOptions
- options to configure the update- Returns:
- the JsonObject instance produced by the operation.
-
findOneAndUpdateWithOptionsAndForget
public MongoClient findOneAndUpdateWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update, io.vertx.ext.mongo.FindOptions findOptions, io.vertx.ext.mongo.UpdateOptions updateOptions)
Variant offindOneAndUpdateWithOptions(String,JsonObject,JsonObject,FindOptions,UpdateOptions)
that ignores the result of the operation.This method subscribes on the result of
findOneAndUpdateWithOptions(String,JsonObject,JsonObject,FindOptions,UpdateOptions)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromfindOneAndUpdateWithOptions(String,JsonObject,JsonObject,FindOptions,UpdateOptions)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionquery
- the query used to match the documentupdate
- used to describe how the documents will be updatedfindOptions
- options to configure the findupdateOptions
- options to configure the update- Returns:
- the instance of MongoClient to chain method calls.
-
findOneAndReplace
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject> findOneAndReplace(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace)
Find a single matching document in the specified collection and replace it.This operation might change _id field of query parameter
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionquery
- the query used to match the documentreplace
- the replacement document- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
findOneAndReplaceAndAwait
public io.vertx.core.json.JsonObject findOneAndReplaceAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace)
Blocking variant offindOneAndReplace(String,JsonObject,JsonObject)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionquery
- the query used to match the documentreplace
- the replacement document- Returns:
- the JsonObject instance produced by the operation.
-
findOneAndReplaceAndForget
public MongoClient findOneAndReplaceAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace)
Variant offindOneAndReplace(String,JsonObject,JsonObject)
that ignores the result of the operation.This method subscribes on the result of
findOneAndReplace(String,JsonObject,JsonObject)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromfindOneAndReplace(String,JsonObject,JsonObject)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionquery
- the query used to match the documentreplace
- the replacement document- Returns:
- the instance of MongoClient to chain method calls.
-
findOneAndReplaceWithOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject> findOneAndReplaceWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace, io.vertx.ext.mongo.FindOptions findOptions, io.vertx.ext.mongo.UpdateOptions updateOptions)
Find a single matching document in the specified collection and replace it.This operation might change _id field of query parameter
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionquery
- the query used to match the documentreplace
- the replacement documentfindOptions
- options to configure the findupdateOptions
- options to configure the update- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
findOneAndReplaceWithOptionsAndAwait
public io.vertx.core.json.JsonObject findOneAndReplaceWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace, io.vertx.ext.mongo.FindOptions findOptions, io.vertx.ext.mongo.UpdateOptions updateOptions)
Blocking variant offindOneAndReplaceWithOptions(String,JsonObject,JsonObject,FindOptions,UpdateOptions)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionquery
- the query used to match the documentreplace
- the replacement documentfindOptions
- options to configure the findupdateOptions
- options to configure the update- Returns:
- the JsonObject instance produced by the operation.
-
findOneAndReplaceWithOptionsAndForget
public MongoClient findOneAndReplaceWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace, io.vertx.ext.mongo.FindOptions findOptions, io.vertx.ext.mongo.UpdateOptions updateOptions)
Variant offindOneAndReplaceWithOptions(String,JsonObject,JsonObject,FindOptions,UpdateOptions)
that ignores the result of the operation.This method subscribes on the result of
findOneAndReplaceWithOptions(String,JsonObject,JsonObject,FindOptions,UpdateOptions)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromfindOneAndReplaceWithOptions(String,JsonObject,JsonObject,FindOptions,UpdateOptions)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionquery
- the query used to match the documentreplace
- the replacement documentfindOptions
- options to configure the findupdateOptions
- options to configure the update- Returns:
- the instance of MongoClient to chain method calls.
-
findOneAndDelete
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject> findOneAndDelete(String collection, io.vertx.core.json.JsonObject query)
Find a single matching document in the specified collection and delete it.This operation might change _id field of query parameter
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionquery
- the query used to match the document- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
findOneAndDeleteAndAwait
public io.vertx.core.json.JsonObject findOneAndDeleteAndAwait(String collection, io.vertx.core.json.JsonObject query)
Blocking variant offindOneAndDelete(String,JsonObject)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionquery
- the query used to match the document- Returns:
- the JsonObject instance produced by the operation.
-
findOneAndDeleteAndForget
public MongoClient findOneAndDeleteAndForget(String collection, io.vertx.core.json.JsonObject query)
Variant offindOneAndDelete(String,JsonObject)
that ignores the result of the operation.This method subscribes on the result of
findOneAndDelete(String,JsonObject)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromfindOneAndDelete(String,JsonObject)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionquery
- the query used to match the document- Returns:
- the instance of MongoClient to chain method calls.
-
findOneAndDeleteWithOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject> findOneAndDeleteWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.FindOptions findOptions)
Find a single matching document in the specified collection and delete it.This operation might change _id field of query parameter
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionquery
- the query used to match the documentfindOptions
- options to configure the find- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
findOneAndDeleteWithOptionsAndAwait
public io.vertx.core.json.JsonObject findOneAndDeleteWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.FindOptions findOptions)
Blocking variant offindOneAndDeleteWithOptions(String,JsonObject,FindOptions)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionquery
- the query used to match the documentfindOptions
- options to configure the find- Returns:
- the JsonObject instance produced by the operation.
-
findOneAndDeleteWithOptionsAndForget
public MongoClient findOneAndDeleteWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.FindOptions findOptions)
Variant offindOneAndDeleteWithOptions(String,JsonObject,FindOptions)
that ignores the result of the operation.This method subscribes on the result of
findOneAndDeleteWithOptions(String,JsonObject,FindOptions)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromfindOneAndDeleteWithOptions(String,JsonObject,FindOptions)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionquery
- the query used to match the documentfindOptions
- options to configure the find- Returns:
- the instance of MongoClient to chain method calls.
-
count
@CheckReturnValue public io.smallrye.mutiny.Uni<Long> count(String collection, io.vertx.core.json.JsonObject query)
Count matching documents in a collection.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionquery
- query used to match documents- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
countAndAwait
public Long countAndAwait(String collection, io.vertx.core.json.JsonObject query)
Blocking variant ofcount(String,JsonObject)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionquery
- query used to match documents- Returns:
- the Long instance produced by the operation.
-
countAndForget
public MongoClient countAndForget(String collection, io.vertx.core.json.JsonObject query)
Variant ofcount(String,JsonObject)
that ignores the result of the operation.This method subscribes on the result of
count(String,JsonObject)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromcount(String,JsonObject)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionquery
- query used to match documents- Returns:
- the instance of MongoClient to chain method calls.
-
countWithOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<Long> countWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.CountOptions countOptions)
Count matching documents in a collection.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionquery
- query used to match documentscountOptions
-- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
countWithOptionsAndAwait
public Long countWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.CountOptions countOptions)
Blocking variant ofcountWithOptions(String,JsonObject,CountOptions)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionquery
- query used to match documentscountOptions
-- Returns:
- the Long instance produced by the operation.
-
countWithOptionsAndForget
public MongoClient countWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.CountOptions countOptions)
Variant ofcountWithOptions(String,JsonObject,CountOptions)
that ignores the result of the operation.This method subscribes on the result of
countWithOptions(String,JsonObject,CountOptions)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromcountWithOptions(String,JsonObject,CountOptions)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionquery
- query used to match documentscountOptions
-- Returns:
- the instance of MongoClient to chain method calls.
-
removeDocuments
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientDeleteResult> removeDocuments(String collection, io.vertx.core.json.JsonObject query)
Remove matching documents from a collection and return the handler withMongoClientDeleteResult
resultUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionquery
- query used to match documents- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
removeDocumentsAndAwait
public io.vertx.ext.mongo.MongoClientDeleteResult removeDocumentsAndAwait(String collection, io.vertx.core.json.JsonObject query)
Blocking variant ofremoveDocuments(String,JsonObject)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionquery
- query used to match documents- Returns:
- the MongoClientDeleteResult instance produced by the operation.
-
removeDocumentsAndForget
public MongoClient removeDocumentsAndForget(String collection, io.vertx.core.json.JsonObject query)
Variant ofremoveDocuments(String,JsonObject)
that ignores the result of the operation.This method subscribes on the result of
removeDocuments(String,JsonObject)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromremoveDocuments(String,JsonObject)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionquery
- query used to match documents- Returns:
- the instance of MongoClient to chain method calls.
-
removeDocumentsWithOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientDeleteResult> removeDocumentsWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.WriteOption writeOption)
Remove matching documents from a collection with the specified write option and return the handler withMongoClientDeleteResult
resultUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionquery
- query used to match documentswriteOption
- the write option to use- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
removeDocumentsWithOptionsAndAwait
public io.vertx.ext.mongo.MongoClientDeleteResult removeDocumentsWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.WriteOption writeOption)
Blocking variant ofremoveDocumentsWithOptions(String,JsonObject,WriteOption)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionquery
- query used to match documentswriteOption
- the write option to use- Returns:
- the MongoClientDeleteResult instance produced by the operation.
-
removeDocumentsWithOptionsAndForget
public MongoClient removeDocumentsWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.WriteOption writeOption)
Variant ofremoveDocumentsWithOptions(String,JsonObject,WriteOption)
that ignores the result of the operation.This method subscribes on the result of
removeDocumentsWithOptions(String,JsonObject,WriteOption)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromremoveDocumentsWithOptions(String,JsonObject,WriteOption)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionquery
- query used to match documentswriteOption
- the write option to use- Returns:
- the instance of MongoClient to chain method calls.
-
removeDocument
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientDeleteResult> removeDocument(String collection, io.vertx.core.json.JsonObject query)
Remove a single matching document from a collection and return the handler withMongoClientDeleteResult
resultUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionquery
- query used to match document- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
removeDocumentAndAwait
public io.vertx.ext.mongo.MongoClientDeleteResult removeDocumentAndAwait(String collection, io.vertx.core.json.JsonObject query)
Blocking variant ofremoveDocument(String,JsonObject)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionquery
- query used to match document- Returns:
- the MongoClientDeleteResult instance produced by the operation.
-
removeDocumentAndForget
public MongoClient removeDocumentAndForget(String collection, io.vertx.core.json.JsonObject query)
Variant ofremoveDocument(String,JsonObject)
that ignores the result of the operation.This method subscribes on the result of
removeDocument(String,JsonObject)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromremoveDocument(String,JsonObject)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionquery
- query used to match document- Returns:
- the instance of MongoClient to chain method calls.
-
removeDocumentWithOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.mongo.MongoClientDeleteResult> removeDocumentWithOptions(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.WriteOption writeOption)
Remove a single matching document from a collection with the specified write option and return the handler withMongoClientDeleteResult
resultUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionquery
- query used to match documentwriteOption
- the write option to use- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
removeDocumentWithOptionsAndAwait
public io.vertx.ext.mongo.MongoClientDeleteResult removeDocumentWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.WriteOption writeOption)
Blocking variant ofremoveDocumentWithOptions(String,JsonObject,WriteOption)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionquery
- query used to match documentwriteOption
- the write option to use- Returns:
- the MongoClientDeleteResult instance produced by the operation.
-
removeDocumentWithOptionsAndForget
public MongoClient removeDocumentWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.WriteOption writeOption)
Variant ofremoveDocumentWithOptions(String,JsonObject,WriteOption)
that ignores the result of the operation.This method subscribes on the result of
removeDocumentWithOptions(String,JsonObject,WriteOption)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromremoveDocumentWithOptions(String,JsonObject,WriteOption)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionquery
- query used to match documentwriteOption
- the write option to use- Returns:
- the instance of MongoClient to chain method calls.
-
createCollection
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> createCollection(String collectionName)
Create a new collectionUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collectionName
- the name of the collection- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
createCollectionAndAwait
public Void createCollectionAndAwait(String collectionName)
Blocking variant ofcreateCollection(String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collectionName
- the name of the collection- Returns:
- the Void instance produced by the operation.
-
createCollectionAndForget
public MongoClient createCollectionAndForget(String collectionName)
Variant ofcreateCollection(String)
that ignores the result of the operation.This method subscribes on the result of
createCollection(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromcreateCollection(String)
but you don't need to compose it with other operations.- Parameters:
collectionName
- the name of the collection- Returns:
- the instance of MongoClient to chain method calls.
-
createCollectionWithOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> createCollectionWithOptions(String collectionName, io.vertx.ext.mongo.CreateCollectionOptions collectionOptions)
Create a new collection with optionsUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collectionName
- the name of the collectioncollectionOptions
- options of the collection- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
createCollectionWithOptionsAndAwait
public Void createCollectionWithOptionsAndAwait(String collectionName, io.vertx.ext.mongo.CreateCollectionOptions collectionOptions)
Blocking variant ofcreateCollectionWithOptions(String,CreateCollectionOptions)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collectionName
- the name of the collectioncollectionOptions
- options of the collection- Returns:
- the Void instance produced by the operation.
-
createCollectionWithOptionsAndForget
public MongoClient createCollectionWithOptionsAndForget(String collectionName, io.vertx.ext.mongo.CreateCollectionOptions collectionOptions)
Variant ofcreateCollectionWithOptions(String,CreateCollectionOptions)
that ignores the result of the operation.This method subscribes on the result of
createCollectionWithOptions(String,CreateCollectionOptions)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromcreateCollectionWithOptions(String,CreateCollectionOptions)
but you don't need to compose it with other operations.- Parameters:
collectionName
- the name of the collectioncollectionOptions
- options of the collection- Returns:
- the instance of MongoClient to chain method calls.
-
getCollections
@CheckReturnValue public io.smallrye.mutiny.Uni<List<String>> getCollections()
Get a list of all collections in the database.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
getCollectionsAndAwait
public List<String> getCollectionsAndAwait()
Blocking variant ofgetCollections()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the List
instance produced by the operation.
-
getCollectionsAndForget
public MongoClient getCollectionsAndForget()
Variant ofgetCollections()
that ignores the result of the operation.This method subscribes on the result of
getCollections()
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromgetCollections()
but you don't need to compose it with other operations.- Returns:
- the instance of MongoClient to chain method calls.
-
dropCollection
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> dropCollection(String collection)
Drop a collectionUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collection- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
dropCollectionAndAwait
public Void dropCollectionAndAwait(String collection)
Blocking variant ofdropCollection(String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collection- Returns:
- the Void instance produced by the operation.
-
dropCollectionAndForget
public MongoClient dropCollectionAndForget(String collection)
Variant ofdropCollection(String)
that ignores the result of the operation.This method subscribes on the result of
dropCollection(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromdropCollection(String)
but you don't need to compose it with other operations.- Parameters:
collection
- the collection- Returns:
- the instance of MongoClient to chain method calls.
-
createIndex
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> createIndex(String collection, io.vertx.core.json.JsonObject key)
Creates an index.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionkey
- A document that contains the field and value pairs where the field is the index key and the value describes the type of index for that field. For an ascending index on a field, specify a value of 1; for descending index, specify a value of -1.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
createIndexAndAwait
public Void createIndexAndAwait(String collection, io.vertx.core.json.JsonObject key)
Blocking variant ofcreateIndex(String,JsonObject)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionkey
- A document that contains the field and value pairs where the field is the index key and the value describes the type of index for that field. For an ascending index on a field, specify a value of 1; for descending index, specify a value of -1.- Returns:
- the Void instance produced by the operation.
-
createIndexAndForget
public MongoClient createIndexAndForget(String collection, io.vertx.core.json.JsonObject key)
Variant ofcreateIndex(String,JsonObject)
that ignores the result of the operation.This method subscribes on the result of
createIndex(String,JsonObject)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromcreateIndex(String,JsonObject)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionkey
- A document that contains the field and value pairs where the field is the index key and the value describes the type of index for that field. For an ascending index on a field, specify a value of 1; for descending index, specify a value of -1.- Returns:
- the instance of MongoClient to chain method calls.
-
createIndexWithOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> createIndexWithOptions(String collection, io.vertx.core.json.JsonObject key, io.vertx.ext.mongo.IndexOptions options)
Creates an index.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionkey
- A document that contains the field and value pairs where the field is the index key and the value describes the type of index for that field. For an ascending index on a field, specify a value of 1; for descending index, specify a value of -1.options
- the options for the index- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
createIndexWithOptionsAndAwait
public Void createIndexWithOptionsAndAwait(String collection, io.vertx.core.json.JsonObject key, io.vertx.ext.mongo.IndexOptions options)
Blocking variant ofcreateIndexWithOptions(String,JsonObject,IndexOptions)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionkey
- A document that contains the field and value pairs where the field is the index key and the value describes the type of index for that field. For an ascending index on a field, specify a value of 1; for descending index, specify a value of -1.options
- the options for the index- Returns:
- the Void instance produced by the operation.
-
createIndexWithOptionsAndForget
public MongoClient createIndexWithOptionsAndForget(String collection, io.vertx.core.json.JsonObject key, io.vertx.ext.mongo.IndexOptions options)
Variant ofcreateIndexWithOptions(String,JsonObject,IndexOptions)
that ignores the result of the operation.This method subscribes on the result of
createIndexWithOptions(String,JsonObject,IndexOptions)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromcreateIndexWithOptions(String,JsonObject,IndexOptions)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionkey
- A document that contains the field and value pairs where the field is the index key and the value describes the type of index for that field. For an ascending index on a field, specify a value of 1; for descending index, specify a value of -1.options
- the options for the index- Returns:
- the instance of MongoClient to chain method calls.
-
createIndexes
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> createIndexes(String collection, List<io.vertx.ext.mongo.IndexModel> indexes)
creates an indexesUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionindexes
- A model that contains pairs of document and indexOptions, document contains the field and value pairs where the field is the index key and the value describes the type of index for that field. For an ascending index on a field, specify a value of 1; for descending index, specify a value of -1.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
createIndexesAndAwait
public Void createIndexesAndAwait(String collection, List<io.vertx.ext.mongo.IndexModel> indexes)
Blocking variant ofcreateIndexes(String,List)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionindexes
- A model that contains pairs of document and indexOptions, document contains the field and value pairs where the field is the index key and the value describes the type of index for that field. For an ascending index on a field, specify a value of 1; for descending index, specify a value of -1.- Returns:
- the Void instance produced by the operation.
-
createIndexesAndForget
public MongoClient createIndexesAndForget(String collection, List<io.vertx.ext.mongo.IndexModel> indexes)
Variant ofcreateIndexes(String,List)
that ignores the result of the operation.This method subscribes on the result of
createIndexes(String,List)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromcreateIndexes(String,List)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionindexes
- A model that contains pairs of document and indexOptions, document contains the field and value pairs where the field is the index key and the value describes the type of index for that field. For an ascending index on a field, specify a value of 1; for descending index, specify a value of -1.- Returns:
- the instance of MongoClient to chain method calls.
-
listIndexes
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonArray> listIndexes(String collection)
Get all the indexes in this collection.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collection- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
listIndexesAndAwait
public io.vertx.core.json.JsonArray listIndexesAndAwait(String collection)
Blocking variant oflistIndexes(String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collection- Returns:
- the JsonArray instance produced by the operation.
-
listIndexesAndForget
public MongoClient listIndexesAndForget(String collection)
Variant oflistIndexes(String)
that ignores the result of the operation.This method subscribes on the result of
listIndexes(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromlistIndexes(String)
but you don't need to compose it with other operations.- Parameters:
collection
- the collection- Returns:
- the instance of MongoClient to chain method calls.
-
dropIndex
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> dropIndex(String collection, String indexName)
Drops the index given its name.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionindexName
- the name of the index to remove- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
dropIndexAndAwait
public Void dropIndexAndAwait(String collection, String indexName)
Blocking variant ofdropIndex(String,String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionindexName
- the name of the index to remove- Returns:
- the Void instance produced by the operation.
-
dropIndexAndForget
public MongoClient dropIndexAndForget(String collection, String indexName)
Variant ofdropIndex(String,String)
that ignores the result of the operation.This method subscribes on the result of
dropIndex(String,String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromdropIndex(String,String)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionindexName
- the name of the index to remove- Returns:
- the instance of MongoClient to chain method calls.
-
runCommand
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject> runCommand(String commandName, io.vertx.core.json.JsonObject command)
Run an arbitrary MongoDB command.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
commandName
- the name of the commandcommand
- the command- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
runCommandAndAwait
public io.vertx.core.json.JsonObject runCommandAndAwait(String commandName, io.vertx.core.json.JsonObject command)
Blocking variant ofrunCommand(String,JsonObject)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
commandName
- the name of the commandcommand
- the command- Returns:
- the JsonObject instance produced by the operation.
-
runCommandAndForget
public MongoClient runCommandAndForget(String commandName, io.vertx.core.json.JsonObject command)
Variant ofrunCommand(String,JsonObject)
that ignores the result of the operation.This method subscribes on the result of
runCommand(String,JsonObject)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromrunCommand(String,JsonObject)
but you don't need to compose it with other operations.- Parameters:
commandName
- the name of the commandcommand
- the command- Returns:
- the instance of MongoClient to chain method calls.
-
distinct
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonArray> distinct(String collection, String fieldName, String resultClassname)
Gets the distinct values of the specified field name. Return a JsonArray containing distinct values (eg: [ 1 , 89 ])Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionfieldName
- the field nameresultClassname
-- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
distinctAndAwait
public io.vertx.core.json.JsonArray distinctAndAwait(String collection, String fieldName, String resultClassname)
Blocking variant ofdistinct(String,String,String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionfieldName
- the field nameresultClassname
-- Returns:
- the JsonArray instance produced by the operation.
-
distinctAndForget
public MongoClient distinctAndForget(String collection, String fieldName, String resultClassname)
Variant ofdistinct(String,String,String)
that ignores the result of the operation.This method subscribes on the result of
distinct(String,String,String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromdistinct(String,String,String)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionfieldName
- the field nameresultClassname
-- Returns:
- the instance of MongoClient to chain method calls.
-
distinct
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonArray> distinct(String collection, String fieldName, String resultClassname, io.vertx.ext.mongo.DistinctOptions distinctOptions)
Gets the distinct values of the specified field name. Return a JsonArray containing distinct values (eg: [ 1 , 89 ])Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionfieldName
- the field nameresultClassname
-distinctOptions
- options (e.g. collation)- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
distinctAndAwait
public io.vertx.core.json.JsonArray distinctAndAwait(String collection, String fieldName, String resultClassname, io.vertx.ext.mongo.DistinctOptions distinctOptions)
Blocking variant ofdistinct(String,String,String,DistinctOptions)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionfieldName
- the field nameresultClassname
-distinctOptions
- options (e.g. collation)- Returns:
- the JsonArray instance produced by the operation.
-
distinctAndForget
public MongoClient distinctAndForget(String collection, String fieldName, String resultClassname, io.vertx.ext.mongo.DistinctOptions distinctOptions)
Variant ofdistinct(String,String,String,DistinctOptions)
that ignores the result of the operation.This method subscribes on the result of
distinct(String,String,String,DistinctOptions)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromdistinct(String,String,String,DistinctOptions)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionfieldName
- the field nameresultClassname
-distinctOptions
- options (e.g. collation)- Returns:
- the instance of MongoClient to chain method calls.
-
distinctWithQuery
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonArray> distinctWithQuery(String collection, String fieldName, String resultClassname, io.vertx.core.json.JsonObject query)
Gets the distinct values of the specified field name filtered by specified query. Return a JsonArray containing distinct values (eg: [ 1 , 89 ])Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionfieldName
- the field nameresultClassname
-query
- the query- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
distinctWithQueryAndAwait
public io.vertx.core.json.JsonArray distinctWithQueryAndAwait(String collection, String fieldName, String resultClassname, io.vertx.core.json.JsonObject query)
Blocking variant ofdistinctWithQuery(String,String,String,JsonObject)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionfieldName
- the field nameresultClassname
-query
- the query- Returns:
- the JsonArray instance produced by the operation.
-
distinctWithQueryAndForget
public MongoClient distinctWithQueryAndForget(String collection, String fieldName, String resultClassname, io.vertx.core.json.JsonObject query)
Variant ofdistinctWithQuery(String,String,String,JsonObject)
that ignores the result of the operation.This method subscribes on the result of
distinctWithQuery(String,String,String,JsonObject)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromdistinctWithQuery(String,String,String,JsonObject)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionfieldName
- the field nameresultClassname
-query
- the query- Returns:
- the instance of MongoClient to chain method calls.
-
distinctWithQuery
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonArray> distinctWithQuery(String collection, String fieldName, String resultClassname, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.DistinctOptions distinctOptions)
Gets the distinct values of the specified field name filtered by specified query. Return a JsonArray containing distinct values (eg: [ 1 , 89 ])Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
collection
- the collectionfieldName
- the field nameresultClassname
-query
- the querydistinctOptions
- options (e.g. collation)- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
distinctWithQueryAndAwait
public io.vertx.core.json.JsonArray distinctWithQueryAndAwait(String collection, String fieldName, String resultClassname, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.DistinctOptions distinctOptions)
Blocking variant ofdistinctWithQuery(String,String,String,JsonObject,DistinctOptions)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
collection
- the collectionfieldName
- the field nameresultClassname
-query
- the querydistinctOptions
- options (e.g. collation)- Returns:
- the JsonArray instance produced by the operation.
-
distinctWithQueryAndForget
public MongoClient distinctWithQueryAndForget(String collection, String fieldName, String resultClassname, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.DistinctOptions distinctOptions)
Variant ofdistinctWithQuery(String,String,String,JsonObject,DistinctOptions)
that ignores the result of the operation.This method subscribes on the result of
distinctWithQuery(String,String,String,JsonObject,DistinctOptions)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromdistinctWithQuery(String,String,String,JsonObject,DistinctOptions)
but you don't need to compose it with other operations.- Parameters:
collection
- the collectionfieldName
- the field nameresultClassname
-query
- the querydistinctOptions
- options (e.g. collation)- Returns:
- the instance of MongoClient to chain method calls.
-
distinctBatch
public ReadStream<io.vertx.core.json.JsonObject> distinctBatch(String collection, String fieldName, String resultClassname)
- Parameters:
collection
- the collectionfieldName
- the field nameresultClassname
-- Returns:
- a emitting json fragments
-
distinctBatch
public ReadStream<io.vertx.core.json.JsonObject> distinctBatch(String collection, String fieldName, String resultClassname, io.vertx.ext.mongo.DistinctOptions distinctOptions)
- Parameters:
collection
- the collectionfieldName
- the field nameresultClassname
-distinctOptions
- options (e.g. collation)- Returns:
- a emitting json fragments
-
distinctBatchWithQuery
public ReadStream<io.vertx.core.json.JsonObject> distinctBatchWithQuery(String collection, String fieldName, String resultClassname, io.vertx.core.json.JsonObject query)
- Parameters:
collection
- the collectionfieldName
- the field nameresultClassname
-query
- the query- Returns:
- a emitting json fragments
-
distinctBatchWithQuery
public ReadStream<io.vertx.core.json.JsonObject> distinctBatchWithQuery(String collection, String fieldName, String resultClassname, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.DistinctOptions distinctOptions)
- Parameters:
collection
- the collectionfieldName
- the field nameresultClassname
-query
- the querydistinctOptions
- options (e.g. collation)- Returns:
- a emitting json fragments
-
distinctBatchWithQuery
public ReadStream<io.vertx.core.json.JsonObject> distinctBatchWithQuery(String collection, String fieldName, String resultClassname, io.vertx.core.json.JsonObject query, int batchSize)
- Parameters:
collection
- the collectionfieldName
- the field nameresultClassname
-query
- the querybatchSize
- the number of documents to load in a batch- Returns:
- a emitting json fragments
-
distinctBatchWithQuery
public ReadStream<io.vertx.core.json.JsonObject> distinctBatchWithQuery(String collection, String fieldName, String resultClassname, io.vertx.core.json.JsonObject query, int batchSize, io.vertx.ext.mongo.DistinctOptions distinctOptions)
- Parameters:
collection
- the collectionfieldName
- the field nameresultClassname
-query
- the querybatchSize
- the number of documents to load in a batchdistinctOptions
- options (e.g. collation)- Returns:
- a emitting json fragments
-
aggregate
public ReadStream<io.vertx.core.json.JsonObject> aggregate(String collection, io.vertx.core.json.JsonArray pipeline)
- Parameters:
collection
- the collectionpipeline
- aggregation pipeline to be executed- Returns:
-
aggregateWithOptions
public ReadStream<io.vertx.core.json.JsonObject> aggregateWithOptions(String collection, io.vertx.core.json.JsonArray pipeline, io.vertx.ext.mongo.AggregateOptions options)
- Parameters:
collection
- the collectionpipeline
- aggregation pipeline to be executedoptions
- options to configure the aggregation command- Returns:
-
createDefaultGridFsBucketService
@CheckReturnValue public io.smallrye.mutiny.Uni<MongoGridFsClient> createDefaultGridFsBucketService()
Creates aMongoGridFsClient
used to interact with Mongo GridFS.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
createDefaultGridFsBucketServiceAndAwait
public MongoGridFsClient createDefaultGridFsBucketServiceAndAwait()
Blocking variant ofcreateDefaultGridFsBucketService()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the MongoGridFsClient instance produced by the operation.
-
createDefaultGridFsBucketServiceAndForget
public MongoClient createDefaultGridFsBucketServiceAndForget()
Variant ofcreateDefaultGridFsBucketService()
that ignores the result of the operation.This method subscribes on the result of
createDefaultGridFsBucketService()
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromcreateDefaultGridFsBucketService()
but you don't need to compose it with other operations.- Returns:
- the instance of MongoClient to chain method calls.
-
createGridFsBucketService
@CheckReturnValue public io.smallrye.mutiny.Uni<MongoGridFsClient> createGridFsBucketService(String bucketName)
Creates aMongoGridFsClient
used to interact with Mongo GridFS.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
bucketName
- the name of the GridFS bucket- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
createGridFsBucketServiceAndAwait
public MongoGridFsClient createGridFsBucketServiceAndAwait(String bucketName)
Blocking variant ofcreateGridFsBucketService(String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
bucketName
- the name of the GridFS bucket- Returns:
- the MongoGridFsClient instance produced by the operation.
-
createGridFsBucketServiceAndForget
public MongoClient createGridFsBucketServiceAndForget(String bucketName)
Variant ofcreateGridFsBucketService(String)
that ignores the result of the operation.This method subscribes on the result of
createGridFsBucketService(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromcreateGridFsBucketService(String)
but you don't need to compose it with other operations.- Parameters:
bucketName
- the name of the GridFS bucket- Returns:
- the instance of MongoClient to chain method calls.
-
close
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> close()
Close the client and release its resourcesUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
closeAndAwait
public Void closeAndAwait()
Blocking variant ofclose()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
closeAndForget
public void closeAndForget()
-
watch
public ReadStream<com.mongodb.client.model.changestream.ChangeStreamDocument<io.vertx.core.json.JsonObject>> watch(String collection, io.vertx.core.json.JsonArray pipeline, boolean withUpdatedDoc, int batchSize)
- Parameters:
collection
- the collectionpipeline
- watching pipeline to be executedwithUpdatedDoc
- whether to get updated fullDocument for "update" operationbatchSize
- the number of documents to load in a batch- Returns:
-
newInstance
public static MongoClient newInstance(io.vertx.ext.mongo.MongoClient arg)
-
-