Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<MongoClient> |
__TYPE_ARG |
static String |
DEFAULT_DB_NAME
The name of the default database
|
static String |
DEFAULT_POOL_NAME
The name of the default pool
|
Constructor and Description |
---|
MongoClient(MongoClient delegate) |
MongoClient(Object delegate) |
Modifier and Type | Method and Description |
---|---|
ReadStream<JsonObject> |
aggregate(String collection,
JsonArray pipeline)
Run aggregate MongoDB command with default
AggregateOptions . |
ReadStream<JsonObject> |
aggregateWithOptions(String collection,
JsonArray pipeline,
AggregateOptions options)
Run aggregate MongoDB command.
|
Maybe<MongoClientBulkWriteResult> |
bulkWrite(String collection,
List<BulkOperation> operations)
Execute a bulk operation.
|
Maybe<MongoClientBulkWriteResult> |
bulkWriteWithOptions(String collection,
List<BulkOperation> operations,
BulkWriteOptions bulkWriteOptions)
Execute a bulk operation with the specified write options.
|
Completable |
close()
Close the client and release its resources
|
Single<Long> |
count(String collection,
JsonObject query)
Count matching documents in a collection.
|
Single<Long> |
countWithOptions(String collection,
JsonObject query,
CountOptions countOptions)
Count matching documents in a collection.
|
static MongoClient |
create(Vertx vertx,
JsonObject config)
Create a Mongo client which maintains its own data source.
|
Completable |
createCollection(String collectionName)
Create a new collection
|
Completable |
createCollectionWithOptions(String collectionName,
CreateCollectionOptions collectionOptions)
Create a new collection with options
|
Single<MongoGridFsClient> |
createDefaultGridFsBucketService()
Creates a
MongoGridFsClient used to interact with Mongo GridFS. |
Single<MongoGridFsClient> |
createGridFsBucketService(String bucketName)
Creates a
MongoGridFsClient used to interact with Mongo GridFS. |
Completable |
createIndex(String collection,
JsonObject key)
Creates an index.
|
Completable |
createIndexes(String collection,
List<IndexModel> indexes)
creates an indexes
|
Completable |
createIndexWithOptions(String collection,
JsonObject key,
IndexOptions options)
Creates an index.
|
static MongoClient |
createShared(Vertx vertx,
JsonObject config)
Like
createShared(io.vertx.rxjava3.core.Vertx, io.vertx.core.json.JsonObject, java.lang.String) but with the default data source name |
static MongoClient |
createShared(Vertx vertx,
JsonObject config,
String dataSourceName)
Create a Mongo client which shares its data source with any other Mongo clients created with the same
data source name
|
Single<JsonArray> |
distinct(String collection,
String fieldName,
String resultClassname)
Gets the distinct values of the specified field name.
|
Single<JsonArray> |
distinct(String collection,
String fieldName,
String resultClassname,
DistinctOptions distinctOptions)
Gets the distinct values of the specified field name.
|
ReadStream<JsonObject> |
distinctBatch(String collection,
String fieldName,
String resultClassname)
Gets the distinct values of the specified field name.
|
ReadStream<JsonObject> |
distinctBatch(String collection,
String fieldName,
String resultClassname,
DistinctOptions distinctOptions)
Gets the distinct values of the specified field name.
|
ReadStream<JsonObject> |
distinctBatchWithQuery(String collection,
String fieldName,
String resultClassname,
JsonObject query)
Gets the distinct values of the specified field name filtered by specified query.
|
ReadStream<JsonObject> |
distinctBatchWithQuery(String collection,
String fieldName,
String resultClassname,
JsonObject query,
DistinctOptions distinctOptions)
Gets the distinct values of the specified field name filtered by specified query.
|
ReadStream<JsonObject> |
distinctBatchWithQuery(String collection,
String fieldName,
String resultClassname,
JsonObject query,
int batchSize)
Gets the distinct values of the specified field name filtered by specified query.
|
ReadStream<JsonObject> |
distinctBatchWithQuery(String collection,
String fieldName,
String resultClassname,
JsonObject query,
int batchSize,
DistinctOptions distinctOptions)
Gets the distinct values of the specified field name filtered by specified query.
|
Single<JsonArray> |
distinctWithQuery(String collection,
String fieldName,
String resultClassname,
JsonObject query)
Gets the distinct values of the specified field name filtered by specified query.
|
Single<JsonArray> |
distinctWithQuery(String collection,
String fieldName,
String resultClassname,
JsonObject query,
DistinctOptions distinctOptions)
Gets the distinct values of the specified field name filtered by specified query.
|
Completable |
dropCollection(String collection)
Drop a collection
|
Completable |
dropIndex(String collection,
String indexName)
Drops the index given its name.
|
boolean |
equals(Object o) |
Single<List<JsonObject>> |
find(String collection,
JsonObject query)
Find matching documents in the specified collection
|
ReadStream<JsonObject> |
findBatch(String collection,
JsonObject query)
Find matching documents in the specified collection.
|
ReadStream<JsonObject> |
findBatchWithOptions(String collection,
JsonObject query,
FindOptions options)
Find matching documents in the specified collection, specifying options.
|
Maybe<JsonObject> |
findOne(String collection,
JsonObject query,
JsonObject fields)
Find a single matching document in the specified collection
|
Maybe<JsonObject> |
findOneAndDelete(String collection,
JsonObject query)
Find a single matching document in the specified collection and delete it.
|
Maybe<JsonObject> |
findOneAndDeleteWithOptions(String collection,
JsonObject query,
FindOptions findOptions)
Find a single matching document in the specified collection and delete it.
|
Maybe<JsonObject> |
findOneAndReplace(String collection,
JsonObject query,
JsonObject replace)
Find a single matching document in the specified collection and replace it.
|
Maybe<JsonObject> |
findOneAndReplaceWithOptions(String collection,
JsonObject query,
JsonObject replace,
FindOptions findOptions,
UpdateOptions updateOptions)
Find a single matching document in the specified collection and replace it.
|
Maybe<JsonObject> |
findOneAndUpdate(String collection,
JsonObject query,
JsonObject update)
Find a single matching document in the specified collection and update it.
|
Maybe<JsonObject> |
findOneAndUpdateWithOptions(String collection,
JsonObject query,
JsonObject update,
FindOptions findOptions,
UpdateOptions updateOptions)
Find a single matching document in the specified collection and update it.
|
Single<List<JsonObject>> |
findWithOptions(String collection,
JsonObject query,
FindOptions options)
Find matching documents in the specified collection, specifying options
|
Single<List<String>> |
getCollections()
Get a list of all collections in the database.
|
MongoClient |
getDelegate() |
int |
hashCode() |
Maybe<String> |
insert(String collection,
JsonObject document)
Insert a document in the specified collection
|
Maybe<String> |
insertWithOptions(String collection,
JsonObject document,
WriteOption writeOption)
Insert a document in the specified collection with the specified write option
|
Single<JsonArray> |
listIndexes(String collection)
Get all the indexes in this collection.
|
static MongoClient |
newInstance(MongoClient arg) |
Maybe<MongoClientDeleteResult> |
removeDocument(String collection,
JsonObject query)
Remove a single matching document from a collection and return the handler with
MongoClientDeleteResult result |
Maybe<MongoClientDeleteResult> |
removeDocuments(String collection,
JsonObject query)
Remove matching documents from a collection and return the handler with
MongoClientDeleteResult result |
Maybe<MongoClientDeleteResult> |
removeDocumentsWithOptions(String collection,
JsonObject query,
WriteOption writeOption)
Remove matching documents from a collection with the specified write option and return the handler with
MongoClientDeleteResult result |
Maybe<MongoClientDeleteResult> |
removeDocumentWithOptions(String collection,
JsonObject query,
WriteOption writeOption)
Remove a single matching document from a collection with the specified write option and return the handler with
MongoClientDeleteResult result |
Maybe<MongoClientUpdateResult> |
replaceDocuments(String collection,
JsonObject query,
JsonObject replace)
Replace matching documents in the specified collection and return the handler with
MongoClientUpdateResult result |
Maybe<MongoClientUpdateResult> |
replaceDocumentsWithOptions(String collection,
JsonObject query,
JsonObject replace,
UpdateOptions options)
Replace matching documents in the specified collection, specifying options and return the handler with
MongoClientUpdateResult result |
Maybe<JsonObject> |
runCommand(String commandName,
JsonObject command)
Run an arbitrary MongoDB command.
|
Maybe<MongoClientBulkWriteResult> |
rxBulkWrite(String collection,
List<BulkOperation> operations)
Execute a bulk operation.
|
Maybe<MongoClientBulkWriteResult> |
rxBulkWriteWithOptions(String collection,
List<BulkOperation> operations,
BulkWriteOptions bulkWriteOptions)
Execute a bulk operation with the specified write options.
|
Completable |
rxClose()
Close the client and release its resources
|
Single<Long> |
rxCount(String collection,
JsonObject query)
Count matching documents in a collection.
|
Single<Long> |
rxCountWithOptions(String collection,
JsonObject query,
CountOptions countOptions)
Count matching documents in a collection.
|
Completable |
rxCreateCollection(String collectionName)
Create a new collection
|
Completable |
rxCreateCollectionWithOptions(String collectionName,
CreateCollectionOptions collectionOptions)
Create a new collection with options
|
Single<MongoGridFsClient> |
rxCreateDefaultGridFsBucketService()
Creates a
MongoGridFsClient used to interact with Mongo GridFS. |
Single<MongoGridFsClient> |
rxCreateGridFsBucketService(String bucketName)
Creates a
MongoGridFsClient used to interact with Mongo GridFS. |
Completable |
rxCreateIndex(String collection,
JsonObject key)
Creates an index.
|
Completable |
rxCreateIndexes(String collection,
List<IndexModel> indexes)
creates an indexes
|
Completable |
rxCreateIndexWithOptions(String collection,
JsonObject key,
IndexOptions options)
Creates an index.
|
Single<JsonArray> |
rxDistinct(String collection,
String fieldName,
String resultClassname)
Gets the distinct values of the specified field name.
|
Single<JsonArray> |
rxDistinct(String collection,
String fieldName,
String resultClassname,
DistinctOptions distinctOptions)
Gets the distinct values of the specified field name.
|
Single<JsonArray> |
rxDistinctWithQuery(String collection,
String fieldName,
String resultClassname,
JsonObject query)
Gets the distinct values of the specified field name filtered by specified query.
|
Single<JsonArray> |
rxDistinctWithQuery(String collection,
String fieldName,
String resultClassname,
JsonObject query,
DistinctOptions distinctOptions)
Gets the distinct values of the specified field name filtered by specified query.
|
Completable |
rxDropCollection(String collection)
Drop a collection
|
Completable |
rxDropIndex(String collection,
String indexName)
Drops the index given its name.
|
Single<List<JsonObject>> |
rxFind(String collection,
JsonObject query)
Find matching documents in the specified collection
|
Maybe<JsonObject> |
rxFindOne(String collection,
JsonObject query,
JsonObject fields)
Find a single matching document in the specified collection
|
Maybe<JsonObject> |
rxFindOneAndDelete(String collection,
JsonObject query)
Find a single matching document in the specified collection and delete it.
|
Maybe<JsonObject> |
rxFindOneAndDeleteWithOptions(String collection,
JsonObject query,
FindOptions findOptions)
Find a single matching document in the specified collection and delete it.
|
Maybe<JsonObject> |
rxFindOneAndReplace(String collection,
JsonObject query,
JsonObject replace)
Find a single matching document in the specified collection and replace it.
|
Maybe<JsonObject> |
rxFindOneAndReplaceWithOptions(String collection,
JsonObject query,
JsonObject replace,
FindOptions findOptions,
UpdateOptions updateOptions)
Find a single matching document in the specified collection and replace it.
|
Maybe<JsonObject> |
rxFindOneAndUpdate(String collection,
JsonObject query,
JsonObject update)
Find a single matching document in the specified collection and update it.
|
Maybe<JsonObject> |
rxFindOneAndUpdateWithOptions(String collection,
JsonObject query,
JsonObject update,
FindOptions findOptions,
UpdateOptions updateOptions)
Find a single matching document in the specified collection and update it.
|
Single<List<JsonObject>> |
rxFindWithOptions(String collection,
JsonObject query,
FindOptions options)
Find matching documents in the specified collection, specifying options
|
Single<List<String>> |
rxGetCollections()
Get a list of all collections in the database.
|
Maybe<String> |
rxInsert(String collection,
JsonObject document)
Insert a document in the specified collection
|
Maybe<String> |
rxInsertWithOptions(String collection,
JsonObject document,
WriteOption writeOption)
Insert a document in the specified collection with the specified write option
|
Single<JsonArray> |
rxListIndexes(String collection)
Get all the indexes in this collection.
|
Maybe<MongoClientDeleteResult> |
rxRemoveDocument(String collection,
JsonObject query)
Remove a single matching document from a collection and return the handler with
MongoClientDeleteResult result |
Maybe<MongoClientDeleteResult> |
rxRemoveDocuments(String collection,
JsonObject query)
Remove matching documents from a collection and return the handler with
MongoClientDeleteResult result |
Maybe<MongoClientDeleteResult> |
rxRemoveDocumentsWithOptions(String collection,
JsonObject query,
WriteOption writeOption)
Remove matching documents from a collection with the specified write option and return the handler with
MongoClientDeleteResult result |
Maybe<MongoClientDeleteResult> |
rxRemoveDocumentWithOptions(String collection,
JsonObject query,
WriteOption writeOption)
Remove a single matching document from a collection with the specified write option and return the handler with
MongoClientDeleteResult result |
Maybe<MongoClientUpdateResult> |
rxReplaceDocuments(String collection,
JsonObject query,
JsonObject replace)
Replace matching documents in the specified collection and return the handler with
MongoClientUpdateResult result |
Maybe<MongoClientUpdateResult> |
rxReplaceDocumentsWithOptions(String collection,
JsonObject query,
JsonObject replace,
UpdateOptions options)
Replace matching documents in the specified collection, specifying options and return the handler with
MongoClientUpdateResult result |
Maybe<JsonObject> |
rxRunCommand(String commandName,
JsonObject command)
Run an arbitrary MongoDB command.
|
Maybe<String> |
rxSave(String collection,
JsonObject document)
Save a document in the specified collection
|
Maybe<String> |
rxSaveWithOptions(String collection,
JsonObject document,
WriteOption writeOption)
Save a document in the specified collection with the specified write option
|
Maybe<MongoClientUpdateResult> |
rxUpdateCollection(String collection,
JsonObject query,
JsonArray update)
Use an aggregation pipeline to update documents in the specified collection and return the handler with
MongoClientUpdateResult result |
Maybe<MongoClientUpdateResult> |
rxUpdateCollection(String collection,
JsonObject query,
JsonObject update)
Update matching documents in the specified collection and return the handler with
MongoClientUpdateResult result |
Maybe<MongoClientUpdateResult> |
rxUpdateCollectionWithOptions(String collection,
JsonObject query,
JsonArray update,
UpdateOptions options)
Use an aggregation pipeline to update documents in the specified collection, specifying options and return the handler with
MongoClientUpdateResult result |
Maybe<MongoClientUpdateResult> |
rxUpdateCollectionWithOptions(String collection,
JsonObject query,
JsonObject update,
UpdateOptions options)
Update matching documents in the specified collection, specifying options and return the handler with
MongoClientUpdateResult result |
Maybe<String> |
save(String collection,
JsonObject document)
Save a document in the specified collection
|
Maybe<String> |
saveWithOptions(String collection,
JsonObject document,
WriteOption writeOption)
Save a document in the specified collection with the specified write option
|
String |
toString() |
Maybe<MongoClientUpdateResult> |
updateCollection(String collection,
JsonObject query,
JsonArray update)
Use an aggregation pipeline to update documents in the specified collection and return the handler with
MongoClientUpdateResult result |
Maybe<MongoClientUpdateResult> |
updateCollection(String collection,
JsonObject query,
JsonObject update)
Update matching documents in the specified collection and return the handler with
MongoClientUpdateResult result |
Maybe<MongoClientUpdateResult> |
updateCollectionWithOptions(String collection,
JsonObject query,
JsonArray update,
UpdateOptions options)
Use an aggregation pipeline to update documents in the specified collection, specifying options and return the handler with
MongoClientUpdateResult result |
Maybe<MongoClientUpdateResult> |
updateCollectionWithOptions(String collection,
JsonObject query,
JsonObject update,
UpdateOptions options)
Update matching documents in the specified collection, specifying options and return the handler with
MongoClientUpdateResult result |
ReadStream<com.mongodb.client.model.changestream.ChangeStreamDocument<JsonObject>> |
watch(String collection,
JsonArray pipeline,
boolean withUpdatedDoc,
int batchSize)
Watch the collection change.
|
public static final io.vertx.lang.rx.TypeArg<MongoClient> __TYPE_ARG
public static final String DEFAULT_POOL_NAME
public static final String DEFAULT_DB_NAME
public MongoClient(MongoClient delegate)
public MongoClient(Object delegate)
public MongoClient getDelegate()
public static MongoClient create(Vertx vertx, JsonObject config)
vertx
- the Vert.x instanceconfig
- the configurationpublic static MongoClient createShared(Vertx vertx, JsonObject config, String dataSourceName)
vertx
- the Vert.x instanceconfig
- the configurationdataSourceName
- the data source namepublic static MongoClient createShared(Vertx vertx, JsonObject config)
createShared(io.vertx.rxjava3.core.Vertx, io.vertx.core.json.JsonObject, java.lang.String)
but with the default data source namevertx
- the Vert.x instanceconfig
- the configurationpublic Maybe<String> save(String collection, JsonObject document)
This operation might change _id field of document parameter
collection
- the collectiondocument
- the documentpublic Maybe<String> rxSave(String collection, JsonObject document)
This operation might change _id field of document parameter
collection
- the collectiondocument
- the documentpublic Maybe<String> saveWithOptions(String collection, JsonObject document, WriteOption writeOption)
This operation might change _id field of document parameter
collection
- the collectiondocument
- the documentwriteOption
- the write option to usepublic Maybe<String> rxSaveWithOptions(String collection, JsonObject document, WriteOption writeOption)
This operation might change _id field of document parameter
collection
- the collectiondocument
- the documentwriteOption
- the write option to usepublic Maybe<String> insert(String collection, JsonObject document)
This operation might change _id field of document parameter
collection
- the collectiondocument
- the documentpublic Maybe<String> rxInsert(String collection, JsonObject document)
This operation might change _id field of document parameter
collection
- the collectiondocument
- the documentpublic Maybe<String> insertWithOptions(String collection, JsonObject document, WriteOption writeOption)
This operation might change _id field of document parameter
collection
- the collectiondocument
- the documentwriteOption
- the write option to usepublic Maybe<String> rxInsertWithOptions(String collection, JsonObject document, WriteOption writeOption)
This operation might change _id field of document parameter
collection
- the collectiondocument
- the documentwriteOption
- the write option to usepublic Maybe<MongoClientUpdateResult> updateCollection(String collection, JsonObject query, JsonObject update)
MongoClientUpdateResult
resultcollection
- the collectionquery
- query used to match the documentsupdate
- used to describe how the documents will be updatedpublic Maybe<MongoClientUpdateResult> rxUpdateCollection(String collection, JsonObject query, JsonObject update)
MongoClientUpdateResult
resultcollection
- the collectionquery
- query used to match the documentsupdate
- used to describe how the documents will be updatedpublic Maybe<MongoClientUpdateResult> updateCollection(String collection, JsonObject query, JsonArray update)
MongoClientUpdateResult
resultcollection
- the collectionquery
- query used to match the documentsupdate
- used to describe how the documents will be updatedpublic Maybe<MongoClientUpdateResult> rxUpdateCollection(String collection, JsonObject query, JsonArray update)
MongoClientUpdateResult
resultcollection
- the collectionquery
- query used to match the documentsupdate
- used to describe how the documents will be updatedpublic Maybe<MongoClientUpdateResult> updateCollectionWithOptions(String collection, JsonObject query, JsonObject update, UpdateOptions options)
MongoClientUpdateResult
resultcollection
- the collectionquery
- query used to match the documentsupdate
- used to describe how the documents will be updatedoptions
- options to configure the updatepublic Maybe<MongoClientUpdateResult> rxUpdateCollectionWithOptions(String collection, JsonObject query, JsonObject update, UpdateOptions options)
MongoClientUpdateResult
resultcollection
- the collectionquery
- query used to match the documentsupdate
- used to describe how the documents will be updatedoptions
- options to configure the updatepublic Maybe<MongoClientUpdateResult> updateCollectionWithOptions(String collection, JsonObject query, JsonArray update, UpdateOptions options)
MongoClientUpdateResult
resultcollection
- the collectionquery
- query used to match the documentsupdate
- aggregation pipeline used to describe how documents will be updatedoptions
- options to configure the updatepublic Maybe<MongoClientUpdateResult> rxUpdateCollectionWithOptions(String collection, JsonObject query, JsonArray update, UpdateOptions options)
MongoClientUpdateResult
resultcollection
- the collectionquery
- query used to match the documentsupdate
- aggregation pipeline used to describe how documents will be updatedoptions
- options to configure the updatepublic Maybe<MongoClientUpdateResult> replaceDocuments(String collection, JsonObject query, JsonObject replace)
MongoClientUpdateResult
resultcollection
- the collectionquery
- query used to match the documentsreplace
- all matching documents will be replaced with thispublic Maybe<MongoClientUpdateResult> rxReplaceDocuments(String collection, JsonObject query, JsonObject replace)
MongoClientUpdateResult
resultcollection
- the collectionquery
- query used to match the documentsreplace
- all matching documents will be replaced with thispublic Maybe<MongoClientUpdateResult> replaceDocumentsWithOptions(String collection, JsonObject query, JsonObject replace, UpdateOptions options)
MongoClientUpdateResult
resultcollection
- the collectionquery
- query used to match the documentsreplace
- all matching documents will be replaced with thisoptions
- options to configure the replacepublic Maybe<MongoClientUpdateResult> rxReplaceDocumentsWithOptions(String collection, JsonObject query, JsonObject replace, UpdateOptions options)
MongoClientUpdateResult
resultcollection
- the collectionquery
- query used to match the documentsreplace
- all matching documents will be replaced with thisoptions
- options to configure the replacepublic Maybe<MongoClientBulkWriteResult> bulkWrite(String collection, List<BulkOperation> operations)
collection
- the collectionoperations
- the operations to executepublic Maybe<MongoClientBulkWriteResult> rxBulkWrite(String collection, List<BulkOperation> operations)
collection
- the collectionoperations
- the operations to executepublic Maybe<MongoClientBulkWriteResult> bulkWriteWithOptions(String collection, List<BulkOperation> operations, BulkWriteOptions bulkWriteOptions)
collection
- the collectionoperations
- the operations to executebulkWriteOptions
- the write optionspublic Maybe<MongoClientBulkWriteResult> rxBulkWriteWithOptions(String collection, List<BulkOperation> operations, BulkWriteOptions bulkWriteOptions)
collection
- the collectionoperations
- the operations to executebulkWriteOptions
- the write optionspublic Single<List<JsonObject>> find(String collection, JsonObject query)
collection
- the collectionquery
- query used to match documentspublic Single<List<JsonObject>> rxFind(String collection, JsonObject query)
collection
- the collectionquery
- query used to match documentspublic ReadStream<JsonObject> findBatch(String collection, JsonObject query)
collection
- the collectionquery
- query used to match documentspublic Single<List<JsonObject>> findWithOptions(String collection, JsonObject query, FindOptions options)
collection
- the collectionquery
- query used to match documentsoptions
- options to configure the findpublic Single<List<JsonObject>> rxFindWithOptions(String collection, JsonObject query, FindOptions options)
collection
- the collectionquery
- query used to match documentsoptions
- options to configure the findpublic ReadStream<JsonObject> findBatchWithOptions(String collection, JsonObject query, FindOptions options)
collection
- the collectionquery
- query used to match documentsoptions
- options to configure the findpublic Maybe<JsonObject> findOne(String collection, JsonObject query, JsonObject fields)
This operation might change _id field of query parameter
collection
- the collectionquery
- the query used to match the documentfields
- the fieldspublic Maybe<JsonObject> rxFindOne(String collection, JsonObject query, JsonObject fields)
This operation might change _id field of query parameter
collection
- the collectionquery
- the query used to match the documentfields
- the fieldspublic Maybe<JsonObject> findOneAndUpdate(String collection, JsonObject query, JsonObject update)
This operation might change _id field of query parameter
collection
- the collectionquery
- the query used to match the documentupdate
- used to describe how the documents will be updatedpublic Maybe<JsonObject> rxFindOneAndUpdate(String collection, JsonObject query, JsonObject update)
This operation might change _id field of query parameter
collection
- the collectionquery
- the query used to match the documentupdate
- used to describe how the documents will be updatedpublic Maybe<JsonObject> findOneAndUpdateWithOptions(String collection, JsonObject query, JsonObject update, FindOptions findOptions, UpdateOptions updateOptions)
This operation might change _id field of query parameter
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 updatepublic Maybe<JsonObject> rxFindOneAndUpdateWithOptions(String collection, JsonObject query, JsonObject update, FindOptions findOptions, UpdateOptions updateOptions)
This operation might change _id field of query parameter
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 updatepublic Maybe<JsonObject> findOneAndReplace(String collection, JsonObject query, JsonObject replace)
This operation might change _id field of query parameter
collection
- the collectionquery
- the query used to match the documentreplace
- the replacement documentpublic Maybe<JsonObject> rxFindOneAndReplace(String collection, JsonObject query, JsonObject replace)
This operation might change _id field of query parameter
collection
- the collectionquery
- the query used to match the documentreplace
- the replacement documentpublic Maybe<JsonObject> findOneAndReplaceWithOptions(String collection, JsonObject query, JsonObject replace, FindOptions findOptions, UpdateOptions updateOptions)
This operation might change _id field of query parameter
collection
- the collectionquery
- the query used to match the documentreplace
- the replacement documentfindOptions
- options to configure the findupdateOptions
- options to configure the updatepublic Maybe<JsonObject> rxFindOneAndReplaceWithOptions(String collection, JsonObject query, JsonObject replace, FindOptions findOptions, UpdateOptions updateOptions)
This operation might change _id field of query parameter
collection
- the collectionquery
- the query used to match the documentreplace
- the replacement documentfindOptions
- options to configure the findupdateOptions
- options to configure the updatepublic Maybe<JsonObject> findOneAndDelete(String collection, JsonObject query)
This operation might change _id field of query parameter
collection
- the collectionquery
- the query used to match the documentpublic Maybe<JsonObject> rxFindOneAndDelete(String collection, JsonObject query)
This operation might change _id field of query parameter
collection
- the collectionquery
- the query used to match the documentpublic Maybe<JsonObject> findOneAndDeleteWithOptions(String collection, JsonObject query, FindOptions findOptions)
This operation might change _id field of query parameter
collection
- the collectionquery
- the query used to match the documentfindOptions
- options to configure the findpublic Maybe<JsonObject> rxFindOneAndDeleteWithOptions(String collection, JsonObject query, FindOptions findOptions)
This operation might change _id field of query parameter
collection
- the collectionquery
- the query used to match the documentfindOptions
- options to configure the findpublic Single<Long> count(String collection, JsonObject query)
collection
- the collectionquery
- query used to match documentspublic Single<Long> rxCount(String collection, JsonObject query)
collection
- the collectionquery
- query used to match documentspublic Single<Long> countWithOptions(String collection, JsonObject query, CountOptions countOptions)
collection
- the collectionquery
- query used to match documentscountOptions
- public Single<Long> rxCountWithOptions(String collection, JsonObject query, CountOptions countOptions)
collection
- the collectionquery
- query used to match documentscountOptions
- public Maybe<MongoClientDeleteResult> removeDocuments(String collection, JsonObject query)
MongoClientDeleteResult
resultcollection
- the collectionquery
- query used to match documentspublic Maybe<MongoClientDeleteResult> rxRemoveDocuments(String collection, JsonObject query)
MongoClientDeleteResult
resultcollection
- the collectionquery
- query used to match documentspublic Maybe<MongoClientDeleteResult> removeDocumentsWithOptions(String collection, JsonObject query, WriteOption writeOption)
MongoClientDeleteResult
resultcollection
- the collectionquery
- query used to match documentswriteOption
- the write option to usepublic Maybe<MongoClientDeleteResult> rxRemoveDocumentsWithOptions(String collection, JsonObject query, WriteOption writeOption)
MongoClientDeleteResult
resultcollection
- the collectionquery
- query used to match documentswriteOption
- the write option to usepublic Maybe<MongoClientDeleteResult> removeDocument(String collection, JsonObject query)
MongoClientDeleteResult
resultcollection
- the collectionquery
- query used to match documentpublic Maybe<MongoClientDeleteResult> rxRemoveDocument(String collection, JsonObject query)
MongoClientDeleteResult
resultcollection
- the collectionquery
- query used to match documentpublic Maybe<MongoClientDeleteResult> removeDocumentWithOptions(String collection, JsonObject query, WriteOption writeOption)
MongoClientDeleteResult
resultcollection
- the collectionquery
- query used to match documentwriteOption
- the write option to usepublic Maybe<MongoClientDeleteResult> rxRemoveDocumentWithOptions(String collection, JsonObject query, WriteOption writeOption)
MongoClientDeleteResult
resultcollection
- the collectionquery
- query used to match documentwriteOption
- the write option to usepublic Completable createCollection(String collectionName)
collectionName
- the name of the collectionpublic Completable rxCreateCollection(String collectionName)
collectionName
- the name of the collectionpublic Completable createCollectionWithOptions(String collectionName, CreateCollectionOptions collectionOptions)
collectionName
- the name of the collectioncollectionOptions
- options of the collectionpublic Completable rxCreateCollectionWithOptions(String collectionName, CreateCollectionOptions collectionOptions)
collectionName
- the name of the collectioncollectionOptions
- options of the collectionpublic Single<List<String>> getCollections()
public Single<List<String>> rxGetCollections()
public Completable dropCollection(String collection)
collection
- the collectionpublic Completable rxDropCollection(String collection)
collection
- the collectionpublic Completable createIndex(String collection, JsonObject key)
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.public Completable rxCreateIndex(String collection, JsonObject key)
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.public Completable createIndexWithOptions(String collection, JsonObject key, IndexOptions options)
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 indexpublic Completable rxCreateIndexWithOptions(String collection, JsonObject key, IndexOptions options)
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 indexpublic Completable createIndexes(String collection, List<IndexModel> indexes)
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.public Completable rxCreateIndexes(String collection, List<IndexModel> indexes)
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.public Single<JsonArray> listIndexes(String collection)
collection
- the collectionpublic Single<JsonArray> rxListIndexes(String collection)
collection
- the collectionpublic Completable dropIndex(String collection, String indexName)
collection
- the collectionindexName
- the name of the index to removepublic Completable rxDropIndex(String collection, String indexName)
collection
- the collectionindexName
- the name of the index to removepublic Maybe<JsonObject> runCommand(String commandName, JsonObject command)
commandName
- the name of the commandcommand
- the commandpublic Maybe<JsonObject> rxRunCommand(String commandName, JsonObject command)
commandName
- the name of the commandcommand
- the commandpublic Single<JsonArray> distinct(String collection, String fieldName, String resultClassname)
collection
- the collectionfieldName
- the field nameresultClassname
- public Single<JsonArray> rxDistinct(String collection, String fieldName, String resultClassname)
collection
- the collectionfieldName
- the field nameresultClassname
- public Single<JsonArray> distinct(String collection, String fieldName, String resultClassname, DistinctOptions distinctOptions)
collection
- the collectionfieldName
- the field nameresultClassname
- distinctOptions
- options (e.g. collation)public Single<JsonArray> rxDistinct(String collection, String fieldName, String resultClassname, DistinctOptions distinctOptions)
collection
- the collectionfieldName
- the field nameresultClassname
- distinctOptions
- options (e.g. collation)public Single<JsonArray> distinctWithQuery(String collection, String fieldName, String resultClassname, JsonObject query)
collection
- the collectionfieldName
- the field nameresultClassname
- query
- the querypublic Single<JsonArray> rxDistinctWithQuery(String collection, String fieldName, String resultClassname, JsonObject query)
collection
- the collectionfieldName
- the field nameresultClassname
- query
- the querypublic Single<JsonArray> distinctWithQuery(String collection, String fieldName, String resultClassname, JsonObject query, DistinctOptions distinctOptions)
collection
- the collectionfieldName
- the field nameresultClassname
- query
- the querydistinctOptions
- options (e.g. collation)public Single<JsonArray> rxDistinctWithQuery(String collection, String fieldName, String resultClassname, JsonObject query, DistinctOptions distinctOptions)
collection
- the collectionfieldName
- the field nameresultClassname
- query
- the querydistinctOptions
- options (e.g. collation)public ReadStream<JsonObject> distinctBatch(String collection, String fieldName, String resultClassname)
collection
- the collectionfieldName
- the field nameresultClassname
- public ReadStream<JsonObject> distinctBatch(String collection, String fieldName, String resultClassname, DistinctOptions distinctOptions)
collection
- the collectionfieldName
- the field nameresultClassname
- distinctOptions
- options (e.g. collation)public ReadStream<JsonObject> distinctBatchWithQuery(String collection, String fieldName, String resultClassname, JsonObject query)
collection
- the collectionfieldName
- the field nameresultClassname
- query
- the querypublic ReadStream<JsonObject> distinctBatchWithQuery(String collection, String fieldName, String resultClassname, JsonObject query, DistinctOptions distinctOptions)
collection
- the collectionfieldName
- the field nameresultClassname
- query
- the querydistinctOptions
- options (e.g. collation)public ReadStream<JsonObject> distinctBatchWithQuery(String collection, String fieldName, String resultClassname, JsonObject query, int batchSize)
collection
- the collectionfieldName
- the field nameresultClassname
- query
- the querybatchSize
- the number of documents to load in a batchpublic ReadStream<JsonObject> distinctBatchWithQuery(String collection, String fieldName, String resultClassname, JsonObject query, int batchSize, DistinctOptions distinctOptions)
collection
- the collectionfieldName
- the field nameresultClassname
- query
- the querybatchSize
- the number of documents to load in a batchdistinctOptions
- options (e.g. collation)public ReadStream<JsonObject> aggregate(String collection, JsonArray pipeline)
AggregateOptions
.collection
- the collectionpipeline
- aggregation pipeline to be executedpublic ReadStream<JsonObject> aggregateWithOptions(String collection, JsonArray pipeline, AggregateOptions options)
collection
- the collectionpipeline
- aggregation pipeline to be executedoptions
- options to configure the aggregation commandpublic Single<MongoGridFsClient> createDefaultGridFsBucketService()
MongoGridFsClient
used to interact with Mongo GridFS.public Single<MongoGridFsClient> rxCreateDefaultGridFsBucketService()
MongoGridFsClient
used to interact with Mongo GridFS.public Single<MongoGridFsClient> createGridFsBucketService(String bucketName)
MongoGridFsClient
used to interact with Mongo GridFS.bucketName
- the name of the GridFS bucketpublic Single<MongoGridFsClient> rxCreateGridFsBucketService(String bucketName)
MongoGridFsClient
used to interact with Mongo GridFS.bucketName
- the name of the GridFS bucketpublic Completable close()
public Completable rxClose()
public ReadStream<com.mongodb.client.model.changestream.ChangeStreamDocument<JsonObject>> watch(String collection, JsonArray pipeline, boolean withUpdatedDoc, int batchSize)
collection
- the collectionpipeline
- watching pipeline to be executedwithUpdatedDoc
- whether to get updated fullDocument for "update" operationbatchSize
- the number of documents to load in a batchpublic static MongoClient newInstance(MongoClient arg)
Copyright © 2022 Eclipse. All rights reserved.