Class: VertxMongo::MongoClient

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb

Overview

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

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

Direct Known Subclasses

MongoService

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)

21
22
23
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 21

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

+ (::VertxMongo::MongoClient) create_non_shared(vertx = nil, config = nil)

Create a Mongo client which maintains its own data source.

Parameters:

  • vertx (::Vertx::Vertx) (defaults to: nil)
    the Vert.x instance
  • config (Hash{String => Object}) (defaults to: nil)
    the configuration

Returns:

Raises:

  • (ArgumentError)

40
41
42
43
44
45
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 40

def self.create_non_shared(vertx=nil,config=nil)
  if vertx.class.method_defined?(:j_del) && config.class == Hash && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtMongo::MongoClient.java_method(:createNonShared, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(vertx.j_del,::Vertx::Util::Utils.to_json_object(config)),::VertxMongo::MongoClient)
  end
  raise ArgumentError, "Invalid arguments when calling create_non_shared(#{vertx},#{config})"
end

+ (::VertxMongo::MongoClient) create_shared(vertx = nil, config = nil, dataSourceName = nil)

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

Parameters:

  • vertx (::Vertx::Vertx) (defaults to: nil)
    the Vert.x instance
  • config (Hash{String => Object}) (defaults to: nil)
    the configuration
  • dataSourceName (String) (defaults to: nil)
    the data source name

Returns:

Raises:

  • (ArgumentError)

52
53
54
55
56
57
58
59
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 52

def self.create_shared(vertx=nil,config=nil,dataSourceName=nil)
  if vertx.class.method_defined?(:j_del) && config.class == Hash && !block_given? && dataSourceName == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtMongo::MongoClient.java_method(:createShared, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(vertx.j_del,::Vertx::Util::Utils.to_json_object(config)),::VertxMongo::MongoClient)
  elsif vertx.class.method_defined?(:j_del) && config.class == Hash && dataSourceName.class == String && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtMongo::MongoClient.java_method(:createShared, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::java.lang.String.java_class]).call(vertx.j_del,::Vertx::Util::Utils.to_json_object(config),dataSourceName),::VertxMongo::MongoClient)
  end
  raise ArgumentError, "Invalid arguments when calling create_shared(#{vertx},#{config},#{dataSourceName})"
end

+ (Object) DEFAULT_DB_NAME

The name of the default database

709
710
711
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 709

def self.DEFAULT_DB_NAME
  Java::IoVertxExtMongo::MongoClient.DEFAULT_DB_NAME
end

+ (Object) DEFAULT_POOL_NAME

The name of the default pool

705
706
707
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 705

def self.DEFAULT_POOL_NAME
  Java::IoVertxExtMongo::MongoClient.DEFAULT_POOL_NAME
end

+ (Object) j_api_type


30
31
32
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 30

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class


33
34
35
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 33

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

+ (Object) unwrap(obj)


27
28
29
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 27

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

+ (Object) wrap(obj)


24
25
26
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 24

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

Instance Method Details

- (::Vertx::ReadStream) aggregate(collection = nil, pipeline = nil)

Run aggregate MongoDB command with default Hash.

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • pipeline (Array<String,Object>) (defaults to: nil)
    aggregation pipeline to be executed

Returns:

Raises:

  • (ArgumentError)

679
680
681
682
683
684
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 679

def aggregate(collection=nil,pipeline=nil)
  if collection.class == String && pipeline.class == Array && !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:aggregate, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonArray.java_class]).call(collection,::Vertx::Util::Utils.to_json_array(pipeline)),::Vertx::ReadStreamImpl, nil)
  end
  raise ArgumentError, "Invalid arguments when calling aggregate(#{collection},#{pipeline})"
end

- (::Vertx::ReadStream) aggregate_with_options(collection = nil, pipeline = nil, options = nil)

Run aggregate MongoDB command.

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • pipeline (Array<String,Object>) (defaults to: nil)
    aggregation pipeline to be executed
  • options (Hash) (defaults to: nil)
    options to configure the aggregation command

Returns:

Raises:

  • (ArgumentError)

690
691
692
693
694
695
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 690

def aggregate_with_options(collection=nil,pipeline=nil,options=nil)
  if collection.class == String && pipeline.class == Array && options.class == Hash && !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:aggregateWithOptions, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonArray.java_class,Java::IoVertxExtMongo::AggregateOptions.java_class]).call(collection,::Vertx::Util::Utils.to_json_array(pipeline),Java::IoVertxExtMongo::AggregateOptions.new(::Vertx::Util::Utils.to_json_object(options))),::Vertx::ReadStreamImpl, nil)
  end
  raise ArgumentError, "Invalid arguments when calling aggregate_with_options(#{collection},#{pipeline},#{options})"
end

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

Execute a bulk operation. Can insert, update, replace, and/or delete multiple documents with one request.

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • operations (Array<Hash>) (defaults to: nil)
    the operations to execute

Yields:

  • will be called with a Hash when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

235
236
237
238
239
240
241
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 235

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) { ... }

Execute a bulk operation with the specified write options. Can insert, update, replace, and/or delete multiple documents with one request.

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • operations (Array<Hash>) (defaults to: nil)
    the operations to execute
  • bulkWriteOptions (Hash) (defaults to: nil)
    the write options

Yields:

  • will be called with a Hash when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

249
250
251
252
253
254
255
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 249

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.

Close the client and release its resources

Raises:

  • (ArgumentError)

698
699
700
701
702
703
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 698

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) { ... }

Count matching documents in a collection.

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    query used to match documents

Yields:

  • will be provided with the number of matching documents

Returns:

  • (self)

Raises:

  • (ArgumentError)

417
418
419
420
421
422
423
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 417

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) { ... }

Create a new collection

Parameters:

  • collectionName (String) (defaults to: nil)
    the name of the collection

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

528
529
530
531
532
533
534
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 528

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) { ... }

Creates an index.

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • key (Hash{String => Object}) (defaults to: nil)
    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.

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

561
562
563
564
565
566
567
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 561

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) { ... }

Creates an index.

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • key (Hash{String => Object}) (defaults to: nil)
    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 (Hash) (defaults to: nil)
    the options for the index

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

574
575
576
577
578
579
580
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 574

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) { ... }

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

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • fieldName (String) (defaults to: nil)
    the field name
  • resultClassname (String) (defaults to: nil)

Yields:

  • will be provided with array of values.

Returns:

  • (self)

Raises:

  • (ArgumentError)

623
624
625
626
627
628
629
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 623

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

- (::Vertx::ReadStream) distinct_batch(collection = nil, fieldName = nil, resultClassname = nil)

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: 1).

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • fieldName (String) (defaults to: nil)
    the field name
  • resultClassname (String) (defaults to: nil)

Returns:

Raises:

  • (ArgumentError)

652
653
654
655
656
657
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 652

def distinct_batch(collection=nil,fieldName=nil,resultClassname=nil)
  if collection.class == String && fieldName.class == String && resultClassname.class == String && !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:distinctBatch, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(collection,fieldName,resultClassname),::Vertx::ReadStreamImpl, nil)
  end
  raise ArgumentError, "Invalid arguments when calling distinct_batch(#{collection},#{fieldName},#{resultClassname})"
end

- (::Vertx::ReadStream) distinct_batch_with_query(collection = nil, fieldName = nil, resultClassname = nil, query = nil, batchSize = nil)

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

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • fieldName (String) (defaults to: nil)
    the field name
  • resultClassname (String) (defaults to: nil)
  • query (Hash{String => Object}) (defaults to: nil)
    the query
  • batchSize (Fixnum) (defaults to: nil)
    the number of documents to load in a batch

Returns:

Raises:

  • (ArgumentError)

667
668
669
670
671
672
673
674
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 667

def distinct_batch_with_query(collection=nil,fieldName=nil,resultClassname=nil,query=nil,batchSize=nil)
  if collection.class == String && fieldName.class == String && resultClassname.class == String && query.class == Hash && !block_given? && batchSize == nil
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:distinctBatchWithQuery, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(collection,fieldName,resultClassname,::Vertx::Util::Utils.to_json_object(query)),::Vertx::ReadStreamImpl, nil)
  elsif collection.class == String && fieldName.class == String && resultClassname.class == String && query.class == Hash && batchSize.class == Fixnum && !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:distinctBatchWithQuery, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::int.java_class]).call(collection,fieldName,resultClassname,::Vertx::Util::Utils.to_json_object(query),batchSize),::Vertx::ReadStreamImpl, nil)
  end
  raise ArgumentError, "Invalid arguments when calling distinct_batch_with_query(#{collection},#{fieldName},#{resultClassname},#{query},#{batchSize})"
end

- (self) distinct_with_query(collection = nil, fieldName = nil, resultClassname = nil, query = nil) { ... }

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

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • fieldName (String) (defaults to: nil)
    the field name
  • resultClassname (String) (defaults to: nil)
  • query (Hash{String => Object}) (defaults to: nil)
    the query

Yields:

  • will be provided with array of values.

Returns:

  • (self)

Raises:

  • (ArgumentError)

638
639
640
641
642
643
644
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 638

def distinct_with_query(collection=nil,fieldName=nil,resultClassname=nil,query=nil)
  if collection.class == String && fieldName.class == String && resultClassname.class == String && query.class == Hash && block_given?
    @j_del.java_method(:distinctWithQuery, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(collection,fieldName,resultClassname,::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 distinct_with_query(#{collection},#{fieldName},#{resultClassname},#{query})"
end

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

Drop a collection

Parameters:

  • collection (String) (defaults to: nil)
    the collection

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

549
550
551
552
553
554
555
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 549

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) { ... }

Drops the index given its name.

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • indexName (String) (defaults to: nil)
    the name of the index to remove

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

597
598
599
600
601
602
603
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 597

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) { ... }

Find matching documents in the specified collection

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    query used to match documents

Yields:

  • will be provided with list of documents

Returns:

  • (self)

Raises:

  • (ArgumentError)

261
262
263
264
265
266
267
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 261

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

- (::Vertx::ReadStream) find_batch(collection = nil, query = nil)

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

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    query used to match documents

Returns:

Raises:

  • (ArgumentError)

273
274
275
276
277
278
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 273

def find_batch(collection=nil,query=nil)
  if collection.class == String && query.class == Hash && !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:findBatch, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query)),::Vertx::ReadStreamImpl, nil)
  end
  raise ArgumentError, "Invalid arguments when calling find_batch(#{collection},#{query})"
end

- (::Vertx::ReadStream) find_batch_with_options(collection = nil, query = nil, options = nil)

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

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    query used to match documents
  • options (Hash) (defaults to: nil)
    options to configure the find

Returns:

Raises:

  • (ArgumentError)

298
299
300
301
302
303
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 298

def find_batch_with_options(collection=nil,query=nil,options=nil)
  if collection.class == String && query.class == Hash && options.class == Hash && !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:findBatchWithOptions, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxExtMongo::FindOptions.java_class]).call(collection,::Vertx::Util::Utils.to_json_object(query),Java::IoVertxExtMongo::FindOptions.new(::Vertx::Util::Utils.to_json_object(options))),::Vertx::ReadStreamImpl, nil)
  end
  raise ArgumentError, "Invalid arguments when calling find_batch_with_options(#{collection},#{query},#{options})"
end

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

Find a single matching document in the specified collection

This operation might change _id field of query parameter

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    the query used to match the document
  • fields (Hash{String => Object}) (defaults to: nil)
    the fields

Yields:

  • will be provided with the document, if any

Returns:

  • (self)

Raises:

  • (ArgumentError)

312
313
314
315
316
317
318
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 312

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) { ... }

Find a single matching document in the specified collection and delete it.

This operation might change _id field of query parameter

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    the query used to match the document

Yields:

  • will be provided with the deleted document, if any

Returns:

  • (self)

Raises:

  • (ArgumentError)

390
391
392
393
394
395
396
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 390

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) { ... }

Find a single matching document in the specified collection and delete it.

This operation might change _id field of query parameter

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    the query used to match the document
  • findOptions (Hash) (defaults to: nil)
    options to configure the find

Yields:

  • will be provided with the deleted document, if any

Returns:

  • (self)

Raises:

  • (ArgumentError)

405
406
407
408
409
410
411
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 405

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) { ... }

Find a single matching document in the specified collection and replace it.

This operation might change _id field of query parameter

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    the query used to match the document
  • replace (Hash{String => Object}) (defaults to: nil)
    the replacement document

Yields:

  • will be provided with the document, if any

Returns:

  • (self)

Raises:

  • (ArgumentError)

359
360
361
362
363
364
365
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 359

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, replace = nil, findOptions = nil, updateOptions = nil) { ... }

Find a single matching document in the specified collection and replace it.

This operation might change _id field of query parameter

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    the query used to match the document
  • replace (Hash{String => Object}) (defaults to: nil)
    the replacement document
  • findOptions (Hash) (defaults to: nil)
    options to configure the find
  • updateOptions (Hash) (defaults to: nil)
    options to configure the update

Yields:

  • will be provided with the document, if any

Returns:

  • (self)

Raises:

  • (ArgumentError)

376
377
378
379
380
381
382
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 376

def find_one_and_replace_with_options(collection=nil,query=nil,replace=nil,findOptions=nil,updateOptions=nil)
  if collection.class == String && query.class == Hash && replace.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(replace),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},#{replace},#{findOptions},#{updateOptions})"
end

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

Find a single matching document in the specified collection and update it.

This operation might change _id field of query parameter

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    the query used to match the document
  • update (Hash{String => Object}) (defaults to: nil)
    used to describe how the documents will be updated

Yields:

  • will be provided with the document, if any

Returns:

  • (self)

Raises:

  • (ArgumentError)

327
328
329
330
331
332
333
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 327

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) { ... }

Find a single matching document in the specified collection and update it.

This operation might change _id field of query parameter

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    the query used to match the document
  • update (Hash{String => Object}) (defaults to: nil)
    used to describe how the documents will be updated
  • findOptions (Hash) (defaults to: nil)
    options to configure the find
  • updateOptions (Hash) (defaults to: nil)
    options to configure the update

Yields:

  • will be provided with the document, if any

Returns:

  • (self)

Raises:

  • (ArgumentError)

344
345
346
347
348
349
350
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 344

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) { ... }

Find matching documents in the specified collection, specifying options

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    query used to match documents
  • options (Hash) (defaults to: nil)
    options to configure the find

Yields:

  • will be provided with list of documents

Returns:

  • (self)

Raises:

  • (ArgumentError)

285
286
287
288
289
290
291
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 285

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 { ... }

Get a list of all collections in the database.

Yields:

  • will be called with a list of collections.

Returns:

  • (self)

Raises:

  • (ArgumentError)

538
539
540
541
542
543
544
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 538

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) { ... }

Insert a document in the specified collection

This operation might change _id field of document parameter

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • document (Hash{String => Object}) (defaults to: nil)
    the document

Yields:

  • result handler will be provided with the id if document didn't already have one

Returns:

  • (self)

Raises:

  • (ArgumentError)

96
97
98
99
100
101
102
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 96

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) { ... }

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

This operation might change _id field of document parameter

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • document (Hash{String => Object}) (defaults to: nil)
    the document
  • writeOption (:ACKNOWLEDGED, :UNACKNOWLEDGED, :FSYNCED, :JOURNALED, :REPLICA_ACKNOWLEDGED, :MAJORITY) (defaults to: nil)
    the write option to use

Yields:

  • result handler will be provided with the id if document didn't already have one

Returns:

  • (self)

Raises:

  • (ArgumentError)

111
112
113
114
115
116
117
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 111

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) { ... }

Get all the indexes in this collection.

Parameters:

  • collection (String) (defaults to: nil)
    the collection

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

585
586
587
588
589
590
591
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 585

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) { ... }

Remove matching documents from a collection

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    query used to match documents

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

429
430
431
432
433
434
435
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 429

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) { ... }

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

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    query used to match document

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

491
492
493
494
495
496
497
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 491

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) { ... }

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

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    query used to match document
  • writeOption (:ACKNOWLEDGED, :UNACKNOWLEDGED, :FSYNCED, :JOURNALED, :REPLICA_ACKNOWLEDGED, :MAJORITY) (defaults to: nil)
    the write option to use

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

517
518
519
520
521
522
523
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 517

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) { ... }

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

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    query used to match documents

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

441
442
443
444
445
446
447
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 441

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) { ... }

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

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    query used to match documents
  • writeOption (:ACKNOWLEDGED, :UNACKNOWLEDGED, :FSYNCED, :JOURNALED, :REPLICA_ACKNOWLEDGED, :MAJORITY) (defaults to: nil)
    the write option to use

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

467
468
469
470
471
472
473
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 467

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) { ... }

Remove a single matching document from a collection

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    query used to match document

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

479
480
481
482
483
484
485
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 479

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) { ... }

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

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    query used to match document
  • writeOption (:ACKNOWLEDGED, :UNACKNOWLEDGED, :FSYNCED, :JOURNALED, :REPLICA_ACKNOWLEDGED, :MAJORITY) (defaults to: nil)
    the write option to use

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

504
505
506
507
508
509
510
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 504

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) { ... }

Remove matching documents from a collection with the specified write option

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    query used to match documents
  • writeOption (:ACKNOWLEDGED, :UNACKNOWLEDGED, :FSYNCED, :JOURNALED, :REPLICA_ACKNOWLEDGED, :MAJORITY) (defaults to: nil)
    the write option to use

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

454
455
456
457
458
459
460
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 454

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) { ... }

Replace matching documents in the specified collection

This operation might change _id field of replace parameter

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    query used to match the documents
  • replace (Hash{String => Object}) (defaults to: nil)
    all matching documents will be replaced with this

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

180
181
182
183
184
185
186
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 180

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) { ... }

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

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    query used to match the documents
  • replace (Hash{String => Object}) (defaults to: nil)
    all matching documents will be replaced with this

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

193
194
195
196
197
198
199
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 193

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) { ... }

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

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    query used to match the documents
  • replace (Hash{String => Object}) (defaults to: nil)
    all matching documents will be replaced with this
  • options (Hash) (defaults to: nil)
    options to configure the replace

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

223
224
225
226
227
228
229
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 223

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) { ... }

Replace matching documents in the specified collection, specifying options

This operation might change _id field of replace parameter

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    query used to match the documents
  • replace (Hash{String => Object}) (defaults to: nil)
    all matching documents will be replaced with this
  • options (Hash) (defaults to: nil)
    options to configure the replace

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

209
210
211
212
213
214
215
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 209

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) { ... }

Run an arbitrary MongoDB command.

Parameters:

  • commandName (String) (defaults to: nil)
    the name of the command
  • command (Hash{String => Object}) (defaults to: nil)
    the command

Yields:

  • will be called with the result.

Returns:

  • (self)

Raises:

  • (ArgumentError)

609
610
611
612
613
614
615
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 609

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) { ... }

Save a document in the specified collection

This operation might change _id field of document parameter

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • document (Hash{String => Object}) (defaults to: nil)
    the document

Yields:

  • result handler will be provided with the id if document didn't already have one

Returns:

  • (self)

Raises:

  • (ArgumentError)

67
68
69
70
71
72
73
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 67

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) { ... }

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

This operation might change _id field of document parameter

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • document (Hash{String => Object}) (defaults to: nil)
    the document
  • writeOption (:ACKNOWLEDGED, :UNACKNOWLEDGED, :FSYNCED, :JOURNALED, :REPLICA_ACKNOWLEDGED, :MAJORITY) (defaults to: nil)
    the write option to use

Yields:

  • result handler will be provided with the id if document didn't already have one

Returns:

  • (self)

Raises:

  • (ArgumentError)

82
83
84
85
86
87
88
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 82

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) { ... }

Update matching documents in the specified collection

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    query used to match the documents
  • update (Hash{String => Object}) (defaults to: nil)
    used to describe how the documents will be updated

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

124
125
126
127
128
129
130
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 124

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) { ... }

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

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    query used to match the documents
  • update (Hash{String => Object}) (defaults to: nil)
    used to describe how the documents will be updated

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

137
138
139
140
141
142
143
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 137

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) { ... }

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

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    query used to match the documents
  • update (Hash{String => Object}) (defaults to: nil)
    used to describe how the documents will be updated
  • options (Hash) (defaults to: nil)
    options to configure the update

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

165
166
167
168
169
170
171
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 165

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) { ... }

Update matching documents in the specified collection, specifying options

Parameters:

  • collection (String) (defaults to: nil)
    the collection
  • query (Hash{String => Object}) (defaults to: nil)
    query used to match the documents
  • update (Hash{String => Object}) (defaults to: nil)
    used to describe how the documents will be updated
  • options (Hash) (defaults to: nil)
    options to configure the update

Yields:

  • will be called when complete

Returns:

  • (self)

Raises:

  • (ArgumentError)

151
152
153
154
155
156
157
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 151

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