Class List Method List File List

# Class: VertxMongo::MongoService

Inherits:
  MongoClient
  - Object
  - MongoClient
  - VertxMongo::MongoService
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (::VertxMongo::MongoService) create_event_bus_proxy(vertx = nil, address = nil)
  Create a proxy to a service that is deployed somewhere on the event bus.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (self) bulk_write(collection = nil, operations = nil) { ... }
- - (self) bulk_write_with_options(collection = nil, operations = nil, bulkWriteOptions = nil) { ... }
- - (void) close
- - (self) count(collection = nil, query = nil) { ... }
- - (self) create_collection(collectionName = nil) { ... }
- - (self) create_index(collection = nil, key = nil) { ... }
- - (self) create_index_with_options(collection = nil, key = nil, options = nil) { ... }
- - (self) distinct(collection = nil, fieldName = nil, resultClassname = nil) { ... }
- - (self) distinct_batch(collection = nil, fieldName = nil, resultClassname = nil) { ... }
- - (self) drop_collection(collection = nil) { ... }
- - (self) drop_index(collection = nil, indexName = nil) { ... }
- - (self) find(collection = nil, query = nil) { ... }
- - (self) find_batch(collection = nil, query = nil) { ... }
- - (self) find_batch_with_options(collection = nil, query = nil, options = nil) { ... }
- - (self) find_one(collection = nil, query = nil, fields = nil) { ... }
- - (self) find_one_and_delete(collection = nil, query = nil) { ... }
- - (self) find_one_and_delete_with_options(collection = nil, query = nil, findOptions = nil) { ... }
- - (self) find_one_and_replace(collection = nil, query = nil, replace = nil) { ... }
- - (self) find_one_and_replace_with_options(collection = nil, query = nil, update = nil, findOptions = nil, updateOptions = nil) { ... }
- - (self) find_one_and_update(collection = nil, query = nil, update = nil) { ... }
- - (self) find_one_and_update_with_options(collection = nil, query = nil, update = nil, findOptions = nil, updateOptions = nil) { ... }
- - (self) find_with_options(collection = nil, query = nil, options = nil) { ... }
- - (self) get_collections { ... }
- - (self) insert(collection = nil, document = nil) { ... }
- - (self) insert_with_options(collection = nil, document = nil, writeOption = nil) { ... }
- - (self) list_indexes(collection = nil) { ... }
- - (self) remove(collection = nil, query = nil) { ... }
- - (self) remove_document(collection = nil, query = nil) { ... }
- - (self) remove_document_with_options(collection = nil, query = nil, writeOption = nil) { ... }
- - (self) remove_documents(collection = nil, query = nil) { ... }
- - (self) remove_documents_with_options(collection = nil, query = nil, writeOption = nil) { ... }
- - (self) remove_one(collection = nil, query = nil) { ... }
- - (self) remove_one_with_options(collection = nil, query = nil, writeOption = nil) { ... }
- - (self) remove_with_options(collection = nil, query = nil, writeOption = nil) { ... }
- - (self) replace(collection = nil, query = nil, replace = nil) { ... }
- - (self) replace_documents(collection = nil, query = nil, replace = nil) { ... }
- - (self) replace_documents_with_options(collection = nil, query = nil, replace = nil, options = nil) { ... }
- - (self) replace_with_options(collection = nil, query = nil, replace = nil, options = nil) { ... }
- - (self) run_command(commandName = nil, command = nil) { ... }
- - (self) save(collection = nil, document = nil) { ... }
- - (self) save_with_options(collection = nil, document = nil, writeOption = nil) { ... }
- - (self) update(collection = nil, query = nil, update = nil) { ... }
- - (self) update_collection(collection = nil, query = nil, update = nil) { ... }
- - (self) update_collection_with_options(collection = nil, query = nil, update = nil, options = nil) { ... }
- - (self) update_with_options(collection = nil, query = nil, update = nil, options = nil) { ... }

### Methods inherited from MongoClient

create_non_shared, create_shared

## Class Method Details

### + (`Boolean`) accept?(obj)

Returns:

- (`Boolean`)

    19
    20
    21
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 19

    def @@j_api_type.accept?(obj)
      obj.class == MongoService
    end

### + (`::VertxMongo::MongoService`) create_event_bus_proxy(vertx = nil, address = nil)

Create a proxy to a service that is deployed somewhere on the event bus

Parameters:

- vertx (`::Vertx::Vertx`) (defaults to: `nil`) —
  the Vert.x instance
- address (`String`) (defaults to: `nil`) —
  the address the service is listening on on the event bus

Returns:

- (`::VertxMongo::MongoService`) —
  the service

Raises:

- (`ArgumentError`)

    38
    39
    40
    41
    42
    43
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 38

    def self.create_event_bus_proxy(vertx=nil,address=nil)
      if vertx.class.method_defined?(:j_del) && address.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtMongo::MongoService.java_method(:createEventBusProxy, [Java::IoVertxCore::Vertx.java_class,Java::java.lang.String.java_class]).call(vertx.j_del,address),::VertxMongo::MongoService)
      end
      raise ArgumentError, "Invalid arguments when calling create_event_bus_proxy(#{vertx},#{address})"
    end

### + (`Object`) j_api_type

    28
    29
    30
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 28

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    31
    32
    33
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 31

    def self.j_class
      Java::IoVertxExtMongo::MongoService.java_class
    end

### + (`Object`) unwrap(obj)

    25
    26
    27
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 25

    def @@j_api_type.unwrap(obj)
      obj.j_del
    end

### + (`Object`) wrap(obj)

    22
    23
    24
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 22

    def @@j_api_type.wrap(obj)
      MongoService.new(obj)
    end

## Instance Method Details

### - (`self`) bulk_write(collection = nil, operations = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- operations (`Array<Hash>`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    194
    195
    196
    197
    198
    199
    200
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 194

    def bulk_write(collection=nil,operations=nil)
      if collection.class == String && operations.class == Array && block_given?
        @j_del.java_method(:bulkWrite, [Java::java.lang.String.java_class,Java::JavaUtil::List.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,operations.map { |element| Java::IoVertxExtMongo::BulkOperation.new(::Vertx::Util::Utils.to_json_object(element)) },(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling bulk_write(#{collection},#{operations})"
    end

### - (`self`) bulk_write_with_options(collection = nil, operations = nil, bulkWriteOptions = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- operations (`Array<Hash>`) (defaults to: `nil`)
- bulkWriteOptions (`Hash`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    206
    207
    208
    209
    210
    211
    212
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 206

    def bulk_write_with_options(collection=nil,operations=nil,bulkWriteOptions=nil)
      if collection.class == String && operations.class == Array && bulkWriteOptions.class == Hash && block_given?
        @j_del.java_method(:bulkWriteWithOptions, [Java::java.lang.String.java_class,Java::JavaUtil::List.java_class,Java::IoVertxExtMongo::BulkWriteOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,operations.map { |element| Java::IoVertxExtMongo::BulkOperation.new(::Vertx::Util::Utils.to_json_object(element)) },Java::IoVertxExtMongo::BulkWriteOptions.new(::Vertx::Util::Utils.to_json_object(bulkWriteOptions)),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling bulk_write_with_options(#{collection},#{operations},#{bulkWriteOptions})"
    end

### - (`void`) close

This method returns an undefined value.

Raises:

- (`ArgumentError`)

    558
    559
    560
    561
    562
    563
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 558

    def close
      if !block_given?
        return @j_del.java_method(:close, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling close()"
    end

### - (`self`) count(collection = nil, query = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    350
    351
    352
    353
    354
    355
    356
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 350

    def count(collection=nil,query=nil)
      if collection.class == String && query.class == Hash && block_given?
        @j_del.java_method(:count, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling count(#{collection},#{query})"
    end

### - (`self`) create_collection(collectionName = nil) { ... }

Parameters:

- collectionName (`String`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    452
    453
    454
    455
    456
    457
    458
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 452

    def create_collection(collectionName=nil)
      if collectionName.class == String && block_given?
        @j_del.java_method(:createCollection, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(collectionName,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling create_collection(#{collectionName})"
    end

### - (`self`) create_index(collection = nil, key = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- key (`Hash{String => Object}`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    482
    483
    484
    485
    486
    487
    488
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 482

    def create_index(collection=nil,key=nil)
      if collection.class == String && key.class == Hash && block_given?
        @j_del.java_method(:createIndex, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(key),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling create_index(#{collection},#{key})"
    end

### - (`self`) create_index_with_options(collection = nil, key = nil, options = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- key (`Hash{String => Object}`) (defaults to: `nil`)
- options (`Hash`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    494
    495
    496
    497
    498
    499
    500
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 494

    def create_index_with_options(collection=nil,key=nil,options=nil)
      if collection.class == String && key.class == Hash && options.class == Hash && block_given?
        @j_del.java_method(:createIndexWithOptions, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxExtMongo::IndexOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(key),Java::IoVertxExtMongo::IndexOptions.new(::Vertx::Util::Utils.to_json_object(options)),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling create_index_with_options(#{collection},#{key},#{options})"
    end

### - (`self`) distinct(collection = nil, fieldName = nil, resultClassname = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- fieldName (`String`) (defaults to: `nil`)
- resultClassname (`String`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    538
    539
    540
    541
    542
    543
    544
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 538

    def distinct(collection=nil,fieldName=nil,resultClassname=nil)
      if collection.class == String && fieldName.class == String && resultClassname.class == String && block_given?
        @j_del.java_method(:distinct, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,fieldName,resultClassname,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling distinct(#{collection},#{fieldName},#{resultClassname})"
    end

### - (`self`) distinct_batch(collection = nil, fieldName = nil, resultClassname = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- fieldName (`String`) (defaults to: `nil`)
- resultClassname (`String`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    550
    551
    552
    553
    554
    555
    556
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 550

    def distinct_batch(collection=nil,fieldName=nil,resultClassname=nil)
      if collection.class == String && fieldName.class == String && resultClassname.class == String && block_given?
        @j_del.java_method(:distinctBatch, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,fieldName,resultClassname,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling distinct_batch(#{collection},#{fieldName},#{resultClassname})"
    end

### - (`self`) drop_collection(collection = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    471
    472
    473
    474
    475
    476
    477
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 471

    def drop_collection(collection=nil)
      if collection.class == String && block_given?
        @j_del.java_method(:dropCollection, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling drop_collection(#{collection})"
    end

### - (`self`) drop_index(collection = nil, indexName = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- indexName (`String`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    515
    516
    517
    518
    519
    520
    521
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 515

    def drop_index(collection=nil,indexName=nil)
      if collection.class == String && indexName.class == String && block_given?
        @j_del.java_method(:dropIndex, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,indexName,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling drop_index(#{collection},#{indexName})"
    end

### - (`self`) find(collection = nil, query = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    217
    218
    219
    220
    221
    222
    223
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 217

    def find(collection=nil,query=nil)
      if collection.class == String && query.class == Hash && block_given?
        @j_del.java_method(:find, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt != nil ? JSON.parse(elt.encode) : nil } : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling find(#{collection},#{query})"
    end

### - (`self`) find_batch(collection = nil, query = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    228
    229
    230
    231
    232
    233
    234
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 228

    def find_batch(collection=nil,query=nil)
      if collection.class == String && query.class == Hash && block_given?
        @j_del.java_method(:findBatch, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling find_batch(#{collection},#{query})"
    end

### - (`self`) find_batch_with_options(collection = nil, query = nil, options = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)
- options (`Hash`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    252
    253
    254
    255
    256
    257
    258
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 252

    def find_batch_with_options(collection=nil,query=nil,options=nil)
      if collection.class == String && query.class == Hash && options.class == Hash && block_given?
        @j_del.java_method(:findBatchWithOptions, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxExtMongo::FindOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),Java::IoVertxExtMongo::FindOptions.new(::Vertx::Util::Utils.to_json_object(options)),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling find_batch_with_options(#{collection},#{query},#{options})"
    end

### - (`self`) find_one(collection = nil, query = nil, fields = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)
- fields (`Hash{String => Object}`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    264
    265
    266
    267
    268
    269
    270
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 264

    def find_one(collection=nil,query=nil,fields=nil)
      if collection.class == String && query.class == Hash && fields.class == Hash && block_given?
        @j_del.java_method(:findOne, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),::Vertx::Util::Utils.to_json_object(fields),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling find_one(#{collection},#{query},#{fields})"
    end

### - (`self`) find_one_and_delete(collection = nil, query = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    327
    328
    329
    330
    331
    332
    333
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 327

    def find_one_and_delete(collection=nil,query=nil)
      if collection.class == String && query.class == Hash && block_given?
        @j_del.java_method(:findOneAndDelete, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling find_one_and_delete(#{collection},#{query})"
    end

### - (`self`) find_one_and_delete_with_options(collection = nil, query = nil, findOptions = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)
- findOptions (`Hash`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    339
    340
    341
    342
    343
    344
    345
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 339

    def find_one_and_delete_with_options(collection=nil,query=nil,findOptions=nil)
      if collection.class == String && query.class == Hash && findOptions.class == Hash && block_given?
        @j_del.java_method(:findOneAndDeleteWithOptions, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxExtMongo::FindOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),Java::IoVertxExtMongo::FindOptions.new(::Vertx::Util::Utils.to_json_object(findOptions)),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling find_one_and_delete_with_options(#{collection},#{query},#{findOptions})"
    end

### - (`self`) find_one_and_replace(collection = nil, query = nil, replace = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)
- replace (`Hash{String => Object}`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    302
    303
    304
    305
    306
    307
    308
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 302

    def find_one_and_replace(collection=nil,query=nil,replace=nil)
      if collection.class == String && query.class == Hash && replace.class == Hash && block_given?
        @j_del.java_method(:findOneAndReplace, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),::Vertx::Util::Utils.to_json_object(replace),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling find_one_and_replace(#{collection},#{query},#{replace})"
    end

### - (`self`) find_one_and_replace_with_options(collection = nil, query = nil, update = nil, findOptions = nil, updateOptions = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)
- update (`Hash{String => Object}`) (defaults to: `nil`)
- findOptions (`Hash`) (defaults to: `nil`)
- updateOptions (`Hash`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    316
    317
    318
    319
    320
    321
    322
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 316

    def find_one_and_replace_with_options(collection=nil,query=nil,update=nil,findOptions=nil,updateOptions=nil)
      if collection.class == String && query.class == Hash && update.class == Hash && findOptions.class == Hash && updateOptions.class == Hash && block_given?
        @j_del.java_method(:findOneAndReplaceWithOptions, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxExtMongo::FindOptions.java_class,Java::IoVertxExtMongo::UpdateOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),::Vertx::Util::Utils.to_json_object(update),Java::IoVertxExtMongo::FindOptions.new(::Vertx::Util::Utils.to_json_object(findOptions)),Java::IoVertxExtMongo::UpdateOptions.new(::Vertx::Util::Utils.to_json_object(updateOptions)),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling find_one_and_replace_with_options(#{collection},#{query},#{update},#{findOptions},#{updateOptions})"
    end

### - (`self`) find_one_and_update(collection = nil, query = nil, update = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)
- update (`Hash{String => Object}`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    276
    277
    278
    279
    280
    281
    282
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 276

    def find_one_and_update(collection=nil,query=nil,update=nil)
      if collection.class == String && query.class == Hash && update.class == Hash && block_given?
        @j_del.java_method(:findOneAndUpdate, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),::Vertx::Util::Utils.to_json_object(update),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling find_one_and_update(#{collection},#{query},#{update})"
    end

### - (`self`) find_one_and_update_with_options(collection = nil, query = nil, update = nil, findOptions = nil, updateOptions = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)
- update (`Hash{String => Object}`) (defaults to: `nil`)
- findOptions (`Hash`) (defaults to: `nil`)
- updateOptions (`Hash`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    290
    291
    292
    293
    294
    295
    296
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 290

    def find_one_and_update_with_options(collection=nil,query=nil,update=nil,findOptions=nil,updateOptions=nil)
      if collection.class == String && query.class == Hash && update.class == Hash && findOptions.class == Hash && updateOptions.class == Hash && block_given?
        @j_del.java_method(:findOneAndUpdateWithOptions, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxExtMongo::FindOptions.java_class,Java::IoVertxExtMongo::UpdateOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),::Vertx::Util::Utils.to_json_object(update),Java::IoVertxExtMongo::FindOptions.new(::Vertx::Util::Utils.to_json_object(findOptions)),Java::IoVertxExtMongo::UpdateOptions.new(::Vertx::Util::Utils.to_json_object(updateOptions)),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling find_one_and_update_with_options(#{collection},#{query},#{update},#{findOptions},#{updateOptions})"
    end

### - (`self`) find_with_options(collection = nil, query = nil, options = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)
- options (`Hash`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    240
    241
    242
    243
    244
    245
    246
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 240

    def find_with_options(collection=nil,query=nil,options=nil)
      if collection.class == String && query.class == Hash && options.class == Hash && block_given?
        @j_del.java_method(:findWithOptions, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxExtMongo::FindOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),Java::IoVertxExtMongo::FindOptions.new(::Vertx::Util::Utils.to_json_object(options)),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt != nil ? JSON.parse(elt.encode) : nil } : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling find_with_options(#{collection},#{query},#{options})"
    end

### - (`self`) get_collections { ... }

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    461
    462
    463
    464
    465
    466
    467
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 461

    def get_collections
      if block_given?
        @j_del.java_method(:getCollections, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt } : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling get_collections()"
    end

### - (`self`) insert(collection = nil, document = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- document (`Hash{String => Object}`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    71
    72
    73
    74
    75
    76
    77
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 71

    def insert(collection=nil,document=nil)
      if collection.class == String && document.class == Hash && block_given?
        @j_del.java_method(:insert, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(document),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling insert(#{collection},#{document})"
    end

### - (`self`) insert_with_options(collection = nil, document = nil, writeOption = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- document (`Hash{String => Object}`) (defaults to: `nil`)
- writeOption (`:ACKNOWLEDGED`, `:UNACKNOWLEDGED`, `:FSYNCED`, `:JOURNALED`, `:REPLICA_ACKNOWLEDGED`, `:MAJORITY`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    83
    84
    85
    86
    87
    88
    89
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 83

    def insert_with_options(collection=nil,document=nil,writeOption=nil)
      if collection.class == String && document.class == Hash && writeOption.class == Symbol && block_given?
        @j_del.java_method(:insertWithOptions, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxExtMongo::WriteOption.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(document),Java::IoVertxExtMongo::WriteOption.valueOf(writeOption.to_s),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling insert_with_options(#{collection},#{document},#{writeOption})"
    end

### - (`self`) list_indexes(collection = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    504
    505
    506
    507
    508
    509
    510
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 504

    def list_indexes(collection=nil)
      if collection.class == String && block_given?
        @j_del.java_method(:listIndexes, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling list_indexes(#{collection})"
    end

### - (`self`) remove(collection = nil, query = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    361
    362
    363
    364
    365
    366
    367
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 361

    def remove(collection=nil,query=nil)
      if collection.class == String && query.class == Hash && block_given?
        @j_del.java_method(:remove, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling remove(#{collection},#{query})"
    end

### - (`self`) remove_document(collection = nil, query = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    418
    419
    420
    421
    422
    423
    424
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 418

    def remove_document(collection=nil,query=nil)
      if collection.class == String && query.class == Hash && block_given?
        @j_del.java_method(:removeDocument, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling remove_document(#{collection},#{query})"
    end

### - (`self`) remove_document_with_options(collection = nil, query = nil, writeOption = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)
- writeOption (`:ACKNOWLEDGED`, `:UNACKNOWLEDGED`, `:FSYNCED`, `:JOURNALED`, `:REPLICA_ACKNOWLEDGED`, `:MAJORITY`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    442
    443
    444
    445
    446
    447
    448
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 442

    def remove_document_with_options(collection=nil,query=nil,writeOption=nil)
      if collection.class == String && query.class == Hash && writeOption.class == Symbol && block_given?
        @j_del.java_method(:removeDocumentWithOptions, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxExtMongo::WriteOption.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),Java::IoVertxExtMongo::WriteOption.valueOf(writeOption.to_s),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling remove_document_with_options(#{collection},#{query},#{writeOption})"
    end

### - (`self`) remove_documents(collection = nil, query = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    372
    373
    374
    375
    376
    377
    378
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 372

    def remove_documents(collection=nil,query=nil)
      if collection.class == String && query.class == Hash && block_given?
        @j_del.java_method(:removeDocuments, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling remove_documents(#{collection},#{query})"
    end

### - (`self`) remove_documents_with_options(collection = nil, query = nil, writeOption = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)
- writeOption (`:ACKNOWLEDGED`, `:UNACKNOWLEDGED`, `:FSYNCED`, `:JOURNALED`, `:REPLICA_ACKNOWLEDGED`, `:MAJORITY`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    396
    397
    398
    399
    400
    401
    402
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 396

    def remove_documents_with_options(collection=nil,query=nil,writeOption=nil)
      if collection.class == String && query.class == Hash && writeOption.class == Symbol && block_given?
        @j_del.java_method(:removeDocumentsWithOptions, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxExtMongo::WriteOption.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),Java::IoVertxExtMongo::WriteOption.valueOf(writeOption.to_s),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling remove_documents_with_options(#{collection},#{query},#{writeOption})"
    end

### - (`self`) remove_one(collection = nil, query = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    407
    408
    409
    410
    411
    412
    413
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 407

    def remove_one(collection=nil,query=nil)
      if collection.class == String && query.class == Hash && block_given?
        @j_del.java_method(:removeOne, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling remove_one(#{collection},#{query})"
    end

### - (`self`) remove_one_with_options(collection = nil, query = nil, writeOption = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)
- writeOption (`:ACKNOWLEDGED`, `:UNACKNOWLEDGED`, `:FSYNCED`, `:JOURNALED`, `:REPLICA_ACKNOWLEDGED`, `:MAJORITY`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    430
    431
    432
    433
    434
    435
    436
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 430

    def remove_one_with_options(collection=nil,query=nil,writeOption=nil)
      if collection.class == String && query.class == Hash && writeOption.class == Symbol && block_given?
        @j_del.java_method(:removeOneWithOptions, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxExtMongo::WriteOption.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),Java::IoVertxExtMongo::WriteOption.valueOf(writeOption.to_s),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling remove_one_with_options(#{collection},#{query},#{writeOption})"
    end

### - (`self`) remove_with_options(collection = nil, query = nil, writeOption = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)
- writeOption (`:ACKNOWLEDGED`, `:UNACKNOWLEDGED`, `:FSYNCED`, `:JOURNALED`, `:REPLICA_ACKNOWLEDGED`, `:MAJORITY`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    384
    385
    386
    387
    388
    389
    390
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 384

    def remove_with_options(collection=nil,query=nil,writeOption=nil)
      if collection.class == String && query.class == Hash && writeOption.class == Symbol && block_given?
        @j_del.java_method(:removeWithOptions, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxExtMongo::WriteOption.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),Java::IoVertxExtMongo::WriteOption.valueOf(writeOption.to_s),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling remove_with_options(#{collection},#{query},#{writeOption})"
    end

### - (`self`) replace(collection = nil, query = nil, replace = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)
- replace (`Hash{String => Object}`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    145
    146
    147
    148
    149
    150
    151
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 145

    def replace(collection=nil,query=nil,replace=nil)
      if collection.class == String && query.class == Hash && replace.class == Hash && block_given?
        @j_del.java_method(:replace, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),::Vertx::Util::Utils.to_json_object(replace),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling replace(#{collection},#{query},#{replace})"
    end

### - (`self`) replace_documents(collection = nil, query = nil, replace = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)
- replace (`Hash{String => Object}`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    157
    158
    159
    160
    161
    162
    163
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 157

    def replace_documents(collection=nil,query=nil,replace=nil)
      if collection.class == String && query.class == Hash && replace.class == Hash && block_given?
        @j_del.java_method(:replaceDocuments, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),::Vertx::Util::Utils.to_json_object(replace),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling replace_documents(#{collection},#{query},#{replace})"
    end

### - (`self`) replace_documents_with_options(collection = nil, query = nil, replace = nil, options = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)
- replace (`Hash{String => Object}`) (defaults to: `nil`)
- options (`Hash`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    183
    184
    185
    186
    187
    188
    189
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 183

    def replace_documents_with_options(collection=nil,query=nil,replace=nil,options=nil)
      if collection.class == String && query.class == Hash && replace.class == Hash && options.class == Hash && block_given?
        @j_del.java_method(:replaceDocumentsWithOptions, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxExtMongo::UpdateOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),::Vertx::Util::Utils.to_json_object(replace),Java::IoVertxExtMongo::UpdateOptions.new(::Vertx::Util::Utils.to_json_object(options)),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling replace_documents_with_options(#{collection},#{query},#{replace},#{options})"
    end

### - (`self`) replace_with_options(collection = nil, query = nil, replace = nil, options = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)
- replace (`Hash{String => Object}`) (defaults to: `nil`)
- options (`Hash`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    170
    171
    172
    173
    174
    175
    176
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 170

    def replace_with_options(collection=nil,query=nil,replace=nil,options=nil)
      if collection.class == String && query.class == Hash && replace.class == Hash && options.class == Hash && block_given?
        @j_del.java_method(:replaceWithOptions, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxExtMongo::UpdateOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),::Vertx::Util::Utils.to_json_object(replace),Java::IoVertxExtMongo::UpdateOptions.new(::Vertx::Util::Utils.to_json_object(options)),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling replace_with_options(#{collection},#{query},#{replace},#{options})"
    end

### - (`self`) run_command(commandName = nil, command = nil) { ... }

Parameters:

- commandName (`String`) (defaults to: `nil`)
- command (`Hash{String => Object}`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    526
    527
    528
    529
    530
    531
    532
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 526

    def run_command(commandName=nil,command=nil)
      if commandName.class == String && command.class == Hash && block_given?
        @j_del.java_method(:runCommand, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(commandName,::Vertx::Util::Utils.to_json_object(command),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling run_command(#{commandName},#{command})"
    end

### - (`self`) save(collection = nil, document = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- document (`Hash{String => Object}`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    48
    49
    50
    51
    52
    53
    54
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 48

    def save(collection=nil,document=nil)
      if collection.class == String && document.class == Hash && block_given?
        @j_del.java_method(:save, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(document),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling save(#{collection},#{document})"
    end

### - (`self`) save_with_options(collection = nil, document = nil, writeOption = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- document (`Hash{String => Object}`) (defaults to: `nil`)
- writeOption (`:ACKNOWLEDGED`, `:UNACKNOWLEDGED`, `:FSYNCED`, `:JOURNALED`, `:REPLICA_ACKNOWLEDGED`, `:MAJORITY`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    60
    61
    62
    63
    64
    65
    66
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 60

    def save_with_options(collection=nil,document=nil,writeOption=nil)
      if collection.class == String && document.class == Hash && writeOption.class == Symbol && block_given?
        @j_del.java_method(:saveWithOptions, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxExtMongo::WriteOption.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(document),Java::IoVertxExtMongo::WriteOption.valueOf(writeOption.to_s),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling save_with_options(#{collection},#{document},#{writeOption})"
    end

### - (`self`) update(collection = nil, query = nil, update = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)
- update (`Hash{String => Object}`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    95
    96
    97
    98
    99
    100
    101
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 95

    def update(collection=nil,query=nil,update=nil)
      if collection.class == String && query.class == Hash && update.class == Hash && block_given?
        @j_del.java_method(:update, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),::Vertx::Util::Utils.to_json_object(update),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling update(#{collection},#{query},#{update})"
    end

### - (`self`) update_collection(collection = nil, query = nil, update = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)
- update (`Hash{String => Object}`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    107
    108
    109
    110
    111
    112
    113
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 107

    def update_collection(collection=nil,query=nil,update=nil)
      if collection.class == String && query.class == Hash && update.class == Hash && block_given?
        @j_del.java_method(:updateCollection, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),::Vertx::Util::Utils.to_json_object(update),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling update_collection(#{collection},#{query},#{update})"
    end

### - (`self`) update_collection_with_options(collection = nil, query = nil, update = nil, options = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)
- update (`Hash{String => Object}`) (defaults to: `nil`)
- options (`Hash`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    133
    134
    135
    136
    137
    138
    139
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 133

    def update_collection_with_options(collection=nil,query=nil,update=nil,options=nil)
      if collection.class == String && query.class == Hash && update.class == Hash && options.class == Hash && block_given?
        @j_del.java_method(:updateCollectionWithOptions, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxExtMongo::UpdateOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),::Vertx::Util::Utils.to_json_object(update),Java::IoVertxExtMongo::UpdateOptions.new(::Vertx::Util::Utils.to_json_object(options)),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling update_collection_with_options(#{collection},#{query},#{update},#{options})"
    end

### - (`self`) update_with_options(collection = nil, query = nil, update = nil, options = nil) { ... }

Parameters:

- collection (`String`) (defaults to: `nil`)
- query (`Hash{String => Object}`) (defaults to: `nil`)
- update (`Hash{String => Object}`) (defaults to: `nil`)
- options (`Hash`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    120
    121
    122
    123
    124
    125
    126
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mongo/mongo_service.rb', line 120

    def update_with_options(collection=nil,query=nil,update=nil,options=nil)
      if collection.class == String && query.class == Hash && update.class == Hash && options.class == Hash && block_given?
        @j_del.java_method(:updateWithOptions, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxExtMongo::UpdateOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),::Vertx::Util::Utils.to_json_object(update),Java::IoVertxExtMongo::UpdateOptions.new(::Vertx::Util::Utils.to_json_object(options)),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling update_with_options(#{collection},#{query},#{update},#{options})"
    end