Package: io.vertx.groovy.ext.mongo

## [Groovy] Class MongoClient

- io.vertx.groovy.ext.mongo.MongoClient

- A Vert.x service used to interact with MongoDB server instances.

  Some of the operations might change _id field of passed document.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `MongoClient (java.lang.Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `void` | `close()` Close the client and release its resources
    `MongoClient` | `count(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Long>> resultHandler)` Count matching documents in a collection.
    `MongoClient` | `createCollection(java.lang.String collectionName, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)` Create a new collection
    `MongoClient` | `createIndex(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> key, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)` Creates an index.
    `MongoClient` | `createIndexWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> key, java.util.Map<java.lang.String, java.lang.Object> options, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)` Creates an index.
    `static MongoClient` | `createNonShared(Vertx vertx, java.util.Map<java.lang.String, java.lang.Object> config)` Create a Mongo client which maintains its own data source.
    `static MongoClient` | `createShared(Vertx vertx, java.util.Map<java.lang.String, java.lang.Object> config, java.lang.String dataSourceName)` Create a Mongo client which shares its data source with any other Mongo clients created with the same data source name
    `static MongoClient` | `createShared(Vertx vertx, java.util.Map<java.lang.String, java.lang.Object> config)` Like MongoClient.createShared but with the default data source name
    `MongoClient` | `distinct(java.lang.String collection, java.lang.String fieldName, java.lang.String resultClassname, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.lang.Object>>> resultHandler)` Gets the distinct values of the specified field name.
    `MongoClient` | `distinctBatch(java.lang.String collection, java.lang.String fieldName, java.lang.String resultClassname, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)` Gets the distinct values of the specified field name.
    `MongoClient` | `dropCollection(java.lang.String collection, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)` Drop a collection
    `MongoClient` | `dropIndex(java.lang.String collection, java.lang.String indexName, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)` Drops the index given its name.
    `MongoClient` | `find(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.util.Map<java.lang.String, java.lang.Object>>>> resultHandler)` Find matching documents in the specified collection
    `MongoClient` | `findBatch(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)` Find matching documents in the specified collection.
    `MongoClient` | `findBatchWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> options, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)` Find matching documents in the specified collection, specifying options.
    `MongoClient` | `findOne(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> fields, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)` Find a single matching document in the specified collection
    `MongoClient` | `findWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> options, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.util.Map<java.lang.String, java.lang.Object>>>> resultHandler)` Find matching documents in the specified collection, specifying options
    `MongoClient` | `getCollections(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.lang.String>>> resultHandler)` Get a list of all collections in the database.
    `java.lang.Object` | `getDelegate()`
    `MongoClient` | `insert(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> document, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> resultHandler)` Insert a document in the specified collection
    `MongoClient` | `insertWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> document, io.vertx.ext.mongo.WriteOption writeOption, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> resultHandler)` Insert a document in the specified collection with the specified write option
    `MongoClient` | `listIndexes(java.lang.String collection, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.lang.Object>>> resultHandler)` Get all the indexes in this collection.
    `MongoClient` | `remove(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)` Remove matching documents from a collection
    `MongoClient` | `removeDocument(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)` Remove a single matching document from a collection and return the handler with MongoClientDeleteResult result
    `MongoClient` | `removeDocumentWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.ext.mongo.WriteOption writeOption, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)` Remove a single matching document from a collection with the specified write option and return the handler with MongoClientDeleteResult result
    `MongoClient` | `removeDocuments(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)` Remove matching documents from a collection and return the handler with MongoClientDeleteResult result
    `MongoClient` | `removeDocumentsWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.ext.mongo.WriteOption writeOption, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)` Remove matching documents from a collection with the specified write option and return the handler with MongoClientDeleteResult result
    `MongoClient` | `removeOne(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)` Remove a single matching document from a collection
    `MongoClient` | `removeOneWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.ext.mongo.WriteOption writeOption, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)` Remove a single matching document from a collection with the specified write option
    `MongoClient` | `removeWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.ext.mongo.WriteOption writeOption, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)` Remove matching documents from a collection with the specified write option
    `MongoClient` | `replace(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> replace, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)` Replace matching documents in the specified collection
    `MongoClient` | `replaceDocuments(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> replace, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)` Replace matching documents in the specified collection and return the handler with MongoClientUpdateResult result
    `MongoClient` | `replaceDocumentsWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> replace, java.util.Map<java.lang.String, java.lang.Object> options, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)` Replace matching documents in the specified collection, specifying options and return the handler with MongoClientUpdateResult result
    `MongoClient` | `replaceWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> replace, java.util.Map<java.lang.String, java.lang.Object> options, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)` Replace matching documents in the specified collection, specifying options
    `MongoClient` | `runCommand(java.lang.String commandName, java.util.Map<java.lang.String, java.lang.Object> command, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)` Run an arbitrary MongoDB command.
    `MongoClient` | `save(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> document, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> resultHandler)` Save a document in the specified collection
    `MongoClient` | `saveWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> document, io.vertx.ext.mongo.WriteOption writeOption, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> resultHandler)` Save a document in the specified collection with the specified write option
    `MongoClient` | `update(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> update, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)` Update matching documents in the specified collection
    `MongoClient` | `updateCollection(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> update, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)` Update matching documents in the specified collection and return the handler with MongoClientUpdateResult result
    `MongoClient` | `updateCollectionWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> update, java.util.Map<java.lang.String, java.lang.Object> options, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)` Update matching documents in the specified collection, specifying options and return the handler with MongoClientUpdateResult result
    `MongoClient` | `updateWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> update, java.util.Map<java.lang.String, java.lang.Object> options, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)` Update matching documents in the specified collection, specifying options

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Constructor Detail

    - #### MongoClient(java.lang.Object delegate)

  - ### Method Detail

    - #### void close()

      Close the client and release its resources

    - #### MongoClient count(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Long>> resultHandler)

      Count matching documents in a collection.

      Returns:
      Parameters:
        `collection` - the collection
        `query` - query used to match documents
        `resultHandler` - will be provided with the number of matching documents

    - #### MongoClient createCollection(java.lang.String collectionName, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)

      Create a new collection

      Returns:
      Parameters:
        `collectionName` - the name of the collection
        `resultHandler` - will be called when complete

    - #### MongoClient createIndex(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> key, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)

      Creates an index.

      Returns:
      Parameters:
        `collection` - the collection
        `key` - 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.
        `resultHandler` - will be called when complete

    - #### MongoClient createIndexWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> key, java.util.Map<java.lang.String, java.lang.Object> options, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)

      Creates an index.

      Returns:
      Parameters:
        `collection` - the collection
        `key` - 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 (see IndexOptions)
        `resultHandler` - will be called when complete

    - #### static MongoClient createNonShared(Vertx vertx, java.util.Map<java.lang.String, java.lang.Object> config)

      Create a Mongo client which maintains its own data source.

      Returns:
        the client
      Parameters:
        `vertx` - the Vert.x instance
        `config` - the configuration

    - #### static MongoClient createShared(Vertx vertx, java.util.Map<java.lang.String, java.lang.Object> config, java.lang.String dataSourceName)

      Create a Mongo client which shares its data source with any other Mongo clients created with the same data source name

      Returns:
        the client
      Parameters:
        `vertx` - the Vert.x instance
        `config` - the configuration
        `dataSourceName` - the data source name

    - #### static MongoClient createShared(Vertx vertx, java.util.Map<java.lang.String, java.lang.Object> config)

      Like MongoClient.createShared but with the default data source name

      Returns:
        the client
      Parameters:
        `vertx` - the Vert.x instance
        `config` - the configuration

    - #### MongoClient distinct(java.lang.String collection, java.lang.String fieldName, java.lang.String resultClassname, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.lang.Object>>> resultHandler)

      Gets the distinct values of the specified field name. Return a JsonArray containing distinct values (eg: [ 1 , 89 ])

      Returns:
      Parameters:
        `collection` - the collection
        `fieldName` - the field name
        resultClassname
        `resultHandler` - will be provided with array of values.

    - #### MongoClient distinctBatch(java.lang.String collection, java.lang.String fieldName, java.lang.String resultClassname, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)

      Gets the distinct values of the specified field name. This method use batchCursor for returning each found value. Each value is a json fragment with fieldName key (eg: {"num": 1}).

      Returns:
      Parameters:
        `collection` - the collection
        `fieldName` - the field name
        resultClassname
        `resultHandler` - will be provided with each found value

    - #### MongoClient dropCollection(java.lang.String collection, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)

      Drop a collection

      Returns:
      Parameters:
        `collection` - the collection
        `resultHandler` - will be called when complete

    - #### MongoClient dropIndex(java.lang.String collection, java.lang.String indexName, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)

      Drops the index given its name.

      Returns:
      Parameters:
        `collection` - the collection
        `indexName` - the name of the index to remove
        `resultHandler` - will be called when complete

    - #### MongoClient find(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.util.Map<java.lang.String, java.lang.Object>>>> resultHandler)

      Find matching documents in the specified collection

      Returns:
      Parameters:
        `collection` - the collection
        `query` - query used to match documents
        `resultHandler` - will be provided with list of documents

    - #### MongoClient findBatch(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)

      Find matching documents in the specified collection. This method use batchCursor for returning each found document.

      Returns:
      Parameters:
        `collection` - the collection
        `query` - query used to match documents
        `resultHandler` - will be provided with each found document

    - #### MongoClient findBatchWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> options, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)

      Find matching documents in the specified collection, specifying options. This method use batchCursor for returning each found document.

      Returns:
      Parameters:
        `collection` - the collection
        `query` - query used to match documents
        `options` - options to configure the find (see FindOptions)
        `resultHandler` - will be provided with each found document

    - #### MongoClient findOne(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> fields, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)

      Find a single matching document in the specified collection

      This operation might change _id field of query parameter

      Returns:
      Parameters:
        `collection` - the collection
        `query` - the query used to match the document
        `fields` - the fields
        `resultHandler` - will be provided with the document, if any

    - #### MongoClient findWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> options, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.util.Map<java.lang.String, java.lang.Object>>>> resultHandler)

      Find matching documents in the specified collection, specifying options

      Returns:
      Parameters:
        `collection` - the collection
        `query` - query used to match documents
        `options` - options to configure the find (see FindOptions)
        `resultHandler` - will be provided with list of documents

    - #### MongoClient getCollections(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.lang.String>>> resultHandler)

      Get a list of all collections in the database.

      Returns:
      Parameters:
        `resultHandler` - will be called with a list of collections.

    - #### java.lang.Object getDelegate()

    - #### MongoClient insert(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> document, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> resultHandler)

      Insert a document in the specified collection

      This operation might change _id field of document parameter

      Returns:
      Parameters:
        `collection` - the collection
        `document` - the document
        `resultHandler` - result handler will be provided with the id if document didn't already have one

    - #### MongoClient insertWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> document, io.vertx.ext.mongo.WriteOption writeOption, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> resultHandler)

      Insert a document in the specified collection with the specified write option

      This operation might change _id field of document parameter

      Returns:
      Parameters:
        `collection` - the collection
        `document` - the document
        `writeOption` - the write option to use
        `resultHandler` - result handler will be provided with the id if document didn't already have one

    - #### MongoClient listIndexes(java.lang.String collection, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.lang.Object>>> resultHandler)

      Get all the indexes in this collection.

      Returns:
      Parameters:
        `collection` - the collection
        `resultHandler` - will be called when complete

    - #### MongoClient remove(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)

      Remove matching documents from a collection

      Returns:
      Parameters:
        `collection` - the collection
        `query` - query used to match documents
        `resultHandler` - will be called when complete

    - #### MongoClient removeDocument(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)

      Remove a single matching document from a collection and return the handler with MongoClientDeleteResult result

      Returns:
      Parameters:
        `collection` - the collection
        `query` - query used to match document
        `resultHandler` - will be called when complete

    - #### MongoClient removeDocumentWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.ext.mongo.WriteOption writeOption, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)

      Remove a single matching document from a collection with the specified write option and return the handler with MongoClientDeleteResult result

      Returns:
      Parameters:
        `collection` - the collection
        `query` - query used to match document
        `writeOption` - the write option to use
        `resultHandler` - will be called when complete

    - #### MongoClient removeDocuments(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)

      Remove matching documents from a collection and return the handler with MongoClientDeleteResult result

      Returns:
      Parameters:
        `collection` - the collection
        `query` - query used to match documents
        `resultHandler` - will be called when complete

    - #### MongoClient removeDocumentsWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.ext.mongo.WriteOption writeOption, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)

      Remove matching documents from a collection with the specified write option and return the handler with MongoClientDeleteResult result

      Returns:
      Parameters:
        `collection` - the collection
        `query` - query used to match documents
        `writeOption` - the write option to use
        `resultHandler` - will be called when complete

    - #### MongoClient removeOne(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)

      Remove a single matching document from a collection

      Returns:
      Parameters:
        `collection` - the collection
        `query` - query used to match document
        `resultHandler` - will be called when complete

    - #### MongoClient removeOneWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.ext.mongo.WriteOption writeOption, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)

      Remove a single matching document from a collection with the specified write option

      Returns:
      Parameters:
        `collection` - the collection
        `query` - query used to match document
        `writeOption` - the write option to use
        `resultHandler` - will be called when complete

    - #### MongoClient removeWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, io.vertx.ext.mongo.WriteOption writeOption, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)

      Remove matching documents from a collection with the specified write option

      Returns:
      Parameters:
        `collection` - the collection
        `query` - query used to match documents
        `writeOption` - the write option to use
        `resultHandler` - will be called when complete

    - #### MongoClient replace(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> replace, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)

      Replace matching documents in the specified collection

      This operation might change _id field of replace parameter

      Returns:
      Parameters:
        `collection` - the collection
        `query` - query used to match the documents
        `replace` - all matching documents will be replaced with this
        `resultHandler` - will be called when complete

    - #### MongoClient replaceDocuments(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> replace, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)

      Replace matching documents in the specified collection and return the handler with MongoClientUpdateResult result

      Returns:
      Parameters:
        `collection` - the collection
        `query` - query used to match the documents
        `replace` - all matching documents will be replaced with this
        `resultHandler` - will be called when complete

    - #### MongoClient replaceDocumentsWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> replace, java.util.Map<java.lang.String, java.lang.Object> options, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)

      Replace matching documents in the specified collection, specifying options and return the handler with MongoClientUpdateResult result

      Returns:
      Parameters:
        `collection` - the collection
        `query` - query used to match the documents
        `replace` - all matching documents will be replaced with this
        `options` - options to configure the replace (see UpdateOptions)
        `resultHandler` - will be called when complete

    - #### MongoClient replaceWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> replace, java.util.Map<java.lang.String, java.lang.Object> options, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)

      Replace matching documents in the specified collection, specifying options

      This operation might change _id field of replace parameter

      Returns:
      Parameters:
        `collection` - the collection
        `query` - query used to match the documents
        `replace` - all matching documents will be replaced with this
        `options` - options to configure the replace (see UpdateOptions)
        `resultHandler` - will be called when complete

    - #### MongoClient runCommand(java.lang.String commandName, java.util.Map<java.lang.String, java.lang.Object> command, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)

      Run an arbitrary MongoDB command.

      Returns:
      Parameters:
        `commandName` - the name of the command
        `command` - the command
        `resultHandler` - will be called with the result.

    - #### MongoClient save(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> document, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> resultHandler)

      Save a document in the specified collection

      This operation might change _id field of document parameter

      Returns:
      Parameters:
        `collection` - the collection
        `document` - the document
        `resultHandler` - result handler will be provided with the id if document didn't already have one

    - #### MongoClient saveWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> document, io.vertx.ext.mongo.WriteOption writeOption, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> resultHandler)

      Save a document in the specified collection with the specified write option

      This operation might change _id field of document parameter

      Returns:
      Parameters:
        `collection` - the collection
        `document` - the document
        `writeOption` - the write option to use
        `resultHandler` - result handler will be provided with the id if document didn't already have one

    - #### MongoClient update(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> update, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)

      Update matching documents in the specified collection

      Returns:
      Parameters:
        `collection` - the collection
        `query` - query used to match the documents
        `update` - used to describe how the documents will be updated
        `resultHandler` - will be called when complete

    - #### MongoClient updateCollection(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> update, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)

      Update matching documents in the specified collection and return the handler with MongoClientUpdateResult result

      Returns:
      Parameters:
        `collection` - the collection
        `query` - query used to match the documents
        `update` - used to describe how the documents will be updated
        `resultHandler` - will be called when complete

    - #### MongoClient updateCollectionWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> update, java.util.Map<java.lang.String, java.lang.Object> options, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)

      Update matching documents in the specified collection, specifying options and return the handler with MongoClientUpdateResult result

      Returns:
      Parameters:
        `collection` - the collection
        `query` - query used to match the documents
        `update` - used to describe how the documents will be updated
        `options` - options to configure the update (see UpdateOptions)
        `resultHandler` - will be called when complete

    - #### MongoClient updateWithOptions(java.lang.String collection, java.util.Map<java.lang.String, java.lang.Object> query, java.util.Map<java.lang.String, java.lang.Object> update, java.util.Map<java.lang.String, java.lang.Object> options, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)

      Update matching documents in the specified collection, specifying options

      Returns:
      Parameters:
        `collection` - the collection
        `query` - query used to match the documents
        `update` - used to describe how the documents will be updated
        `options` - options to configure the update (see UpdateOptions)
        `resultHandler` - will be called when complete