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.

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


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

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

+ (::VertxMongo::MongoClient) createNonShared(vertx, config)

Create a Mongo client which maintains its own data source.

Parameters:

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

Returns:



1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 1028

def self.create_non_shared(*args)
  if args[0].class.method_defined?(:j_del) && args[1].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(args[0].j_del,::Vertx::Util::Utils.to_json_object(args[1])),::VertxMongo::MongoClient)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling create_non_shared(#{args[0]},#{args[1]})"
  end
end

+ (::VertxMongo::MongoClient) createShared(vertx, config) + (::VertxMongo::MongoClient) createShared(vertx, config, dataSourceName)

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

Overloads:

  • + (::VertxMongo::MongoClient) createShared(vertx, config)

    Parameters:

    • vertx (::Vertx::Vertx)
      the Vert.x instance
    • config (Hash{String => Object})
      the configuration
  • + (::VertxMongo::MongoClient) createShared(vertx, config, dataSourceName)

    Parameters:

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

Returns:



964
965
966
967
968
969
970
971
972
973
974
975
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 964

def self.create_shared(*args)
  if args[0].class.method_defined?(:j_del) && args[1].class == Hash && !block_given? && args[2] == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtMongo::MongoClient.java_method(:createShared, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(args[0].j_del,::Vertx::Util::Utils.to_json_object(args[1])),::VertxMongo::MongoClient)
  elsif args[0].class.method_defined?(:j_del) && args[1].class == Hash && args[2].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(args[0].j_del,::Vertx::Util::Utils.to_json_object(args[1]),args[2]),::VertxMongo::MongoClient)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling create_shared(#{args[0]},#{args[1]},#{args[2]})"
  end
end

+ (Object) DEFAULT_DB_NAME

The name of the default database


1292
1293
1294
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 1292

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

+ (Object) DEFAULT_POOL_NAME

The name of the default pool


1288
1289
1290
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 1288

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

+ (Object) j_api_type



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

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



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

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

+ (Object) unwrap(obj)



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

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

+ (Object) wrap(obj)



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

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

Instance Method Details

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

Run aggregate MongoDB command with default => Object}.

Parameters:

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

Returns:



867
868
869
870
871
872
873
874
875
876
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 867

def aggregate(*args)
  if args[0].class == String && args[1].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(args[0],::Vertx::Util::Utils.to_json_array(args[1])),::Vertx::ReadStreamImpl, nil)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling aggregate(#{args[0]},#{args[1]})"
  end
end

- (::Vertx::ReadStream) aggregateWithOptions(collection, pipeline, options)

Run aggregate MongoDB command.

Parameters:

  • collection (String)
    the collection
  • pipeline (Array<String,Object>)
    aggregation pipeline to be executed
  • options (Hash{String => Object})
    options to configure the aggregation command

Returns:



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

def aggregate_with_options(*args)
  if args[0].class == String && args[1].class == Array && args[2].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(args[0],::Vertx::Util::Utils.to_json_array(args[1]),Java::IoVertxExtMongo::AggregateOptions.new(::Vertx::Util::Utils.to_json_object(args[2]))),::Vertx::ReadStreamImpl, nil)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling aggregate_with_options(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (self) bulkWrite(collection, operations, resultHandler) { ... }

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

Parameters:

  • collection (String)
    the collection
  • operations (Array<Hash{String => Object}>)
    the operations to execute

Yields:

  • will be called with a => Object} when complete

Returns:

  • (self)


646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 646

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

- (self) bulkWriteWithOptions(collection, operations, bulkWriteOptions, resultHandler) { ... }

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

Parameters:

  • collection (String)
    the collection
  • operations (Array<Hash{String => Object}>)
    the operations to execute
  • bulkWriteOptions (Hash{String => Object})
    the write options

Yields:

  • will be called with a => Object} when complete

Returns:

  • (self)


1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 1177

def bulk_write_with_options(*args)
  if args[0].class == String && args[1].class == Array && args[2].class == Hash && true
    if (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(args[0],args[1].map { |element| Java::IoVertxExtMongo::BulkOperation.new(::Vertx::Util::Utils.to_json_object(element)) },Java::IoVertxExtMongo::BulkWriteOptions.new(::Vertx::Util::Utils.to_json_object(args[2])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],args[1].map { |element| Java::IoVertxExtMongo::BulkOperation.new(::Vertx::Util::Utils.to_json_object(element)) },Java::IoVertxExtMongo::BulkWriteOptions.new(::Vertx::Util::Utils.to_json_object(args[2])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtMongo::MongoClientBulkWriteResult))
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling bulk_write_with_options(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (void) close

This method returns an undefined value.

Close the client and release its resources


1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 1041

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

- (self) count(collection, query, resultHandler) { ... }

Count matching documents in a collection.

Parameters:

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

Yields:

  • will be provided with the number of matching documents

Returns:

  • (self)


441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 441

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

- (self) createCollection(collectionName, resultHandler) { ... }

Create a new collection

Parameters:

  • collectionName (String)
    the name of the collection

Yields:

  • will be called when complete

Returns:

  • (self)


623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 623

def create_collection(*args)
  if args[0].class == String && true
    if (block_given?)
      @j_del.java_method(:createCollection, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:createCollection, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling create_collection(#{args[0]})"
  end
end

- (self) createDefaultGridFsBucketService(resultHandler)

Creates a VertxMongo::MongoGridFsClient used to interact with Mongo GridFS.

Returns:

  • (self)


418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 418

def create_default_grid_fs_bucket_service
  if true
    if (block_given?)
      @j_del.java_method(:createDefaultGridFsBucketService, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxMongo::MongoGridFsClient) : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:createDefaultGridFsBucketService, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxMongo::MongoGridFsClient) : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::VertxMongo::MongoGridFsClient.j_api_type)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling create_default_grid_fs_bucket_service()"
  end
end

- (self) createGridFsBucketService(bucketName, resultHandler)

Creates a VertxMongo::MongoGridFsClient used to interact with Mongo GridFS.

Parameters:

  • bucketName (String)
    the name of the GridFS bucket

Returns:

  • (self)


558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 558

def create_grid_fs_bucket_service(*args)
  if args[0].class == String && true
    if (block_given?)
      @j_del.java_method(:createGridFsBucketService, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxMongo::MongoGridFsClient) : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:createGridFsBucketService, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxMongo::MongoGridFsClient) : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::VertxMongo::MongoGridFsClient.j_api_type)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling create_grid_fs_bucket_service(#{args[0]})"
  end
end

- (self) createIndex(collection, key, resultHandler) { ... }

Creates an index.

Parameters:

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


1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 1152

def create_index(*args)
  if args[0].class == String && args[1].class == Hash && true
    if (block_given?)
      @j_del.java_method(:createIndex, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],::Vertx::Util::Utils.to_json_object(args[1]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:createIndex, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],::Vertx::Util::Utils.to_json_object(args[1]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling create_index(#{args[0]},#{args[1]})"
  end
end

- (self) createIndexWithOptions(collection, key, options, resultHandler) { ... }

Creates an index.

Parameters:

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

Yields:

  • will be called when complete

Returns:

  • (self)


156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 156

def create_index_with_options(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Hash && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),Java::IoVertxExtMongo::IndexOptions.new(::Vertx::Util::Utils.to_json_object(args[2])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),Java::IoVertxExtMongo::IndexOptions.new(::Vertx::Util::Utils.to_json_object(args[2])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling create_index_with_options(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (self) createIndexes(collection, indexes, resultHandler) { ... }

creates an indexes

Parameters:

  • collection (String)
    the collection
  • indexes (Array<Hash{String => Object}>)
    A model that contains pairs of document and indexOptions, document contains the field and value pairs where the field is the index key and the value describes the type of index for that field. For an ascending index on a field, specify a value of 1; for descending index, specify a value of -1.

Yields:

  • will be called when complete

Returns:

  • (self)


1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 1057

def create_indexes(*args)
  if args[0].class == String && args[1].class == Array && true
    if (block_given?)
      @j_del.java_method(:createIndexes, [Java::java.lang.String.java_class,Java::JavaUtil::List.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],args[1].map { |element| Java::IoVertxExtMongo::IndexModel.new(::Vertx::Util::Utils.to_json_object(element)) },block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:createIndexes, [Java::java.lang.String.java_class,Java::JavaUtil::List.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],args[1].map { |element| Java::IoVertxExtMongo::IndexModel.new(::Vertx::Util::Utils.to_json_object(element)) },block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling create_indexes(#{args[0]},#{args[1]})"
  end
end

- (self) distinct(collection, fieldName, resultClassname, resultHandler) { ... }

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

Parameters:

  • collection (String)
    the collection
  • fieldName (String)
    the field name
  • resultClassname (String)

Yields:

  • will be provided with array of values.

Returns:

  • (self)


722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 722

def distinct(*args)
  if args[0].class == String && args[1].class == String && args[2].class == String && true
    if (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(args[0],args[1],args[2],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],args[1],args[2],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling distinct(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (::Vertx::ReadStream) distinctBatch(collection, fieldName, resultClassname)

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)
    the collection
  • fieldName (String)
    the field name
  • resultClassname (String)

Returns:



543
544
545
546
547
548
549
550
551
552
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 543

def distinct_batch(*args)
  if args[0].class == String && args[1].class == String && args[2].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(args[0],args[1],args[2]),::Vertx::ReadStreamImpl, nil)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling distinct_batch(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (::Vertx::ReadStream) distinctBatchWithQuery(collection, fieldName, resultClassname, query) - (::Vertx::ReadStream) distinctBatchWithQuery(collection, fieldName, resultClassname, query, batchSize)

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

Overloads:

  • - (::Vertx::ReadStream) distinctBatchWithQuery(collection, fieldName, resultClassname, query)

    Parameters:

    • collection (String)
      the collection
    • fieldName (String)
      the field name
    • resultClassname (String)
    • query (Hash{String => Object})
      the query
  • - (::Vertx::ReadStream) distinctBatchWithQuery(collection, fieldName, resultClassname, query, batchSize)

    Parameters:

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

Returns:



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

def distinct_batch_with_query(*args)
  if args[0].class == String && args[1].class == String && args[2].class == String && args[3].class == Hash && !block_given? && args[4] == 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(args[0],args[1],args[2],::Vertx::Util::Utils.to_json_object(args[3])),::Vertx::ReadStreamImpl, nil)
  elsif args[0].class == String && args[1].class == String && args[2].class == String && args[3].class == Hash && args[4].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(args[0],args[1],args[2],::Vertx::Util::Utils.to_json_object(args[3]),args[4]),::Vertx::ReadStreamImpl, nil)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling distinct_batch_with_query(#{args[0]},#{args[1]},#{args[2]},#{args[3]},#{args[4]})"
  end
end

- (self) distinctWithQuery(collection, fieldName, resultClassname, query, resultHandler) { ... }

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)
    the collection
  • fieldName (String)
    the field name
  • resultClassname (String)
  • query (Hash{String => Object})
    the query

Yields:

  • will be provided with array of values.

Returns:

  • (self)


354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 354

def distinct_with_query(*args)
  if args[0].class == String && args[1].class == String && args[2].class == String && args[3].class == Hash && true
    if (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(args[0],args[1],args[2],::Vertx::Util::Utils.to_json_object(args[3]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],args[1],args[2],::Vertx::Util::Utils.to_json_object(args[3]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling distinct_with_query(#{args[0]},#{args[1]},#{args[2]},#{args[3]})"
  end
end

- (self) dropCollection(collection, resultHandler) { ... }

Drop a collection

Parameters:

  • collection (String)
    the collection

Yields:

  • will be called when complete

Returns:

  • (self)


1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 1246

def drop_collection(*args)
  if args[0].class == String && true
    if (block_given?)
      @j_del.java_method(:dropCollection, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:dropCollection, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling drop_collection(#{args[0]})"
  end
end

- (self) dropIndex(collection, indexName, resultHandler) { ... }

Drops the index given its name.

Parameters:

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

Yields:

  • will be called when complete

Returns:

  • (self)


228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 228

def drop_index(*args)
  if args[0].class == String && args[1].class == String && true
    if (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(args[0],args[1],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:dropIndex, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],args[1],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling drop_index(#{args[0]},#{args[1]})"
  end
end

- (self) find(collection, query, resultHandler) { ... }

Find matching documents in the specified collection

Parameters:

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

Yields:

  • will be provided with list of documents

Returns:

  • (self)


328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 328

def find(*args)
  if args[0].class == String && args[1].class == Hash && true
    if (block_given?)
      @j_del.java_method(:find, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],::Vertx::Util::Utils.to_json_object(args[1]),block_given? ? 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) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:find, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],::Vertx::Util::Utils.to_json_object(args[1]),block_given? ? 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) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling find(#{args[0]},#{args[1]})"
  end
end

- (::Vertx::ReadStream) findBatch(collection, query)

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

Parameters:

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

Returns:



44
45
46
47
48
49
50
51
52
53
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 44

def find_batch(*args)
  if args[0].class == String && args[1].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(args[0],::Vertx::Util::Utils.to_json_object(args[1])),::Vertx::ReadStreamImpl, nil)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling find_batch(#{args[0]},#{args[1]})"
  end
end

- (::Vertx::ReadStream) findBatchWithOptions(collection, query, options)

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

Parameters:

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

Returns:



582
583
584
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 582

def find_batch_with_options(*args)
  if args[0].class == String && args[1].class == Hash && args[2].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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),Java::IoVertxExtMongo::FindOptions.new(::Vertx::Util::Utils.to_json_object(args[2]))),::Vertx::ReadStreamImpl, nil)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling find_batch_with_options(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (self) findOne(collection, query, fields, resultHandler) { ... }

Find a single matching document in the specified collection

This operation might change _id field of query parameter

Parameters:

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

Yields:

  • will be provided with the document, if any

Returns:

  • (self)


672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 672

def find_one(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Hash && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling find_one(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (self) findOneAndDelete(collection, query, resultHandler) { ... }

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

This operation might change _id field of query parameter

Parameters:

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

Yields:

  • will be provided with the deleted document, if any

Returns:

  • (self)


1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 1224

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

- (self) findOneAndDeleteWithOptions(collection, query, findOptions, resultHandler) { ... }

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

This operation might change _id field of query parameter

Parameters:

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

Yields:

  • will be provided with the deleted document, if any

Returns:

  • (self)


601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 601

def find_one_and_delete_with_options(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Hash && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),Java::IoVertxExtMongo::FindOptions.new(::Vertx::Util::Utils.to_json_object(args[2])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),Java::IoVertxExtMongo::FindOptions.new(::Vertx::Util::Utils.to_json_object(args[2])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling find_one_and_delete_with_options(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (self) findOneAndReplace(collection, query, replace, resultHandler) { ... }

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

This operation might change _id field of query parameter

Parameters:

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

Yields:

  • will be provided with the document, if any

Returns:

  • (self)


748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 748

def find_one_and_replace(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Hash && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling find_one_and_replace(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (self) findOneAndReplaceWithOptions(collection, query, replace, findOptions, updateOptions, resultHandler) { ... }

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

This operation might change _id field of query parameter

Parameters:

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

Yields:

  • will be provided with the document, if any

Returns:

  • (self)


495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 495

def find_one_and_replace_with_options(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Hash && args[3].class == Hash && args[4].class == Hash && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),Java::IoVertxExtMongo::FindOptions.new(::Vertx::Util::Utils.to_json_object(args[3])),Java::IoVertxExtMongo::UpdateOptions.new(::Vertx::Util::Utils.to_json_object(args[4])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),Java::IoVertxExtMongo::FindOptions.new(::Vertx::Util::Utils.to_json_object(args[3])),Java::IoVertxExtMongo::UpdateOptions.new(::Vertx::Util::Utils.to_json_object(args[4])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling find_one_and_replace_with_options(#{args[0]},#{args[1]},#{args[2]},#{args[3]},#{args[4]})"
  end
end

- (self) findOneAndUpdate(collection, query, update, resultHandler) { ... }

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

This operation might change _id field of query parameter

Parameters:

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

Yields:

  • will be provided with the document, if any

Returns:

  • (self)


205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 205

def find_one_and_update(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Hash && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling find_one_and_update(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (self) findOneAndUpdateWithOptions(collection, query, update, findOptions, updateOptions, resultHandler) { ... }

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

This operation might change _id field of query parameter

Parameters:

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

Yields:

  • will be provided with the document, if any

Returns:

  • (self)


913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 913

def find_one_and_update_with_options(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Hash && args[3].class == Hash && args[4].class == Hash && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),Java::IoVertxExtMongo::FindOptions.new(::Vertx::Util::Utils.to_json_object(args[3])),Java::IoVertxExtMongo::UpdateOptions.new(::Vertx::Util::Utils.to_json_object(args[4])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),Java::IoVertxExtMongo::FindOptions.new(::Vertx::Util::Utils.to_json_object(args[3])),Java::IoVertxExtMongo::UpdateOptions.new(::Vertx::Util::Utils.to_json_object(args[4])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling find_one_and_update_with_options(#{args[0]},#{args[1]},#{args[2]},#{args[3]},#{args[4]})"
  end
end

- (self) findWithOptions(collection, query, options, resultHandler) { ... }

Find matching documents in the specified collection, specifying options

Parameters:

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

Yields:

  • will be provided with list of documents

Returns:

  • (self)


937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 937

def find_with_options(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Hash && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),Java::IoVertxExtMongo::FindOptions.new(::Vertx::Util::Utils.to_json_object(args[2])),block_given? ? 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) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),Java::IoVertxExtMongo::FindOptions.new(::Vertx::Util::Utils.to_json_object(args[2])),block_given? ? 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) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling find_with_options(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (self) getCollections(resultHandler) { ... }

Get a list of all collections in the database.

Yields:

  • will be called with a list of collections.

Returns:

  • (self)


132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 132

def get_collections
  if true
    if (block_given?)
      @j_del.java_method(:getCollections, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt } : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:getCollections, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt } : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling get_collections()"
  end
end

- (self) insert(collection, document, resultHandler) { ... }

Insert a document in the specified collection

This operation might change _id field of document parameter

Parameters:

  • collection (String)
    the collection
  • document (Hash{String => Object})
    the document

Yields:

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

Returns:

  • (self)


797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 797

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

- (self) insertWithOptions(collection, document, writeOption, resultHandler) { ... }

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

This operation might change _id field of document parameter

Parameters:

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

Yields:

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

Returns:

  • (self)


467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 467

def insert_with_options(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Symbol && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),Java::IoVertxExtMongo::WriteOption.valueOf(args[2].to_s),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),Java::IoVertxExtMongo::WriteOption.valueOf(args[2].to_s),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling insert_with_options(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (self) listIndexes(collection, resultHandler) { ... }

Get all the indexes in this collection.

Parameters:

  • collection (String)
    the collection

Yields:

  • will be called when complete

Returns:

  • (self)


1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 1199

def list_indexes(*args)
  if args[0].class == String && true
    if (block_given?)
      @j_del.java_method(:listIndexes, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:listIndexes, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling list_indexes(#{args[0]})"
  end
end

- (self) remove(collection, query, resultHandler) { ... }

Remove matching documents from a collection

Parameters:

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

Yields:

  • will be called when complete

Returns:

  • (self)


845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 845

def remove(*args)
  if args[0].class == String && args[1].class == Hash && true
    if (block_given?)
      @j_del.java_method(:remove, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],::Vertx::Util::Utils.to_json_object(args[1]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:remove, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],::Vertx::Util::Utils.to_json_object(args[1]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling remove(#{args[0]},#{args[1]})"
  end
end

- (self) removeDocument(collection, query, resultHandler) { ... }

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

Parameters:

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

Yields:

  • will be called when complete

Returns:

  • (self)


1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 1129

def remove_document(*args)
  if args[0].class == String && args[1].class == Hash && true
    if (block_given?)
      @j_del.java_method(:removeDocument, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],::Vertx::Util::Utils.to_json_object(args[1]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:removeDocument, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],::Vertx::Util::Utils.to_json_object(args[1]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtMongo::MongoClientDeleteResult))
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling remove_document(#{args[0]},#{args[1]})"
  end
end

- (self) removeDocumentWithOptions(collection, query, writeOption, resultHandler) { ... }

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

Parameters:

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

Yields:

  • will be called when complete

Returns:

  • (self)


85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 85

def remove_document_with_options(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Symbol && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),Java::IoVertxExtMongo::WriteOption.valueOf(args[2].to_s),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),Java::IoVertxExtMongo::WriteOption.valueOf(args[2].to_s),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtMongo::MongoClientDeleteResult))
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling remove_document_with_options(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (self) removeDocuments(collection, query, resultHandler) { ... }

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

Parameters:

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

Yields:

  • will be called when complete

Returns:

  • (self)


179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 179

def remove_documents(*args)
  if args[0].class == String && args[1].class == Hash && true
    if (block_given?)
      @j_del.java_method(:removeDocuments, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],::Vertx::Util::Utils.to_json_object(args[1]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:removeDocuments, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],::Vertx::Util::Utils.to_json_object(args[1]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtMongo::MongoClientDeleteResult))
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling remove_documents(#{args[0]},#{args[1]})"
  end
end

- (self) removeDocumentsWithOptions(collection, query, writeOption, resultHandler) { ... }

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

Parameters:

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

Yields:

  • will be called when complete

Returns:

  • (self)


1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 1081

def remove_documents_with_options(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Symbol && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),Java::IoVertxExtMongo::WriteOption.valueOf(args[2].to_s),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),Java::IoVertxExtMongo::WriteOption.valueOf(args[2].to_s),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtMongo::MongoClientDeleteResult))
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling remove_documents_with_options(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (self) removeOne(collection, query, resultHandler) { ... }

Remove a single matching document from a collection

Parameters:

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

Yields:

  • will be called when complete

Returns:

  • (self)


518
519
520
521
522
523
524
525
526
527
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 518

def remove_one(*args)
  if args[0].class == String && args[1].class == Hash && true
    if (block_given?)
      @j_del.java_method(:removeOne, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],::Vertx::Util::Utils.to_json_object(args[1]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:removeOne, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],::Vertx::Util::Utils.to_json_object(args[1]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling remove_one(#{args[0]},#{args[1]})"
  end
end

- (self) removeOneWithOptions(collection, query, writeOption, resultHandler) { ... }

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

Parameters:

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

Yields:

  • will be called when complete

Returns:

  • (self)


305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 305

def remove_one_with_options(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Symbol && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),Java::IoVertxExtMongo::WriteOption.valueOf(args[2].to_s),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),Java::IoVertxExtMongo::WriteOption.valueOf(args[2].to_s),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling remove_one_with_options(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (self) removeWithOptions(collection, query, writeOption, resultHandler) { ... }

Remove matching documents from a collection with the specified write option

Parameters:

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

Yields:

  • will be called when complete

Returns:

  • (self)


61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 61

def remove_with_options(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Symbol && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),Java::IoVertxExtMongo::WriteOption.valueOf(args[2].to_s),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),Java::IoVertxExtMongo::WriteOption.valueOf(args[2].to_s),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling remove_with_options(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (self) replace(collection, query, replace, resultHandler) { ... }

Replace matching documents in the specified collection

This operation might change _id field of replace parameter

Parameters:

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

Yields:

  • will be called when complete

Returns:

  • (self)


111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 111

def replace(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Hash && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling replace(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (self) replaceDocuments(collection, query, replace, resultHandler) { ... }

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

Parameters:

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

Yields:

  • will be called when complete

Returns:

  • (self)


1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 1006

def replace_documents(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Hash && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtMongo::MongoClientUpdateResult))
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling replace_documents(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (self) replaceDocumentsWithOptions(collection, query, replace, options, resultHandler) { ... }

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

Parameters:

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

Yields:

  • will be called when complete

Returns:

  • (self)


1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 1106

def replace_documents_with_options(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Hash && args[3].class == Hash && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),Java::IoVertxExtMongo::UpdateOptions.new(::Vertx::Util::Utils.to_json_object(args[3])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),Java::IoVertxExtMongo::UpdateOptions.new(::Vertx::Util::Utils.to_json_object(args[3])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtMongo::MongoClientUpdateResult))
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling replace_documents_with_options(#{args[0]},#{args[1]},#{args[2]},#{args[3]})"
  end
end

- (self) replaceWithOptions(collection, query, replace, options, resultHandler) { ... }

Replace matching documents in the specified collection, specifying options

This operation might change _id field of replace parameter

Parameters:

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

Yields:

  • will be called when complete

Returns:

  • (self)


381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 381

def replace_with_options(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Hash && args[3].class == Hash && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),Java::IoVertxExtMongo::UpdateOptions.new(::Vertx::Util::Utils.to_json_object(args[3])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),Java::IoVertxExtMongo::UpdateOptions.new(::Vertx::Util::Utils.to_json_object(args[3])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling replace_with_options(#{args[0]},#{args[1]},#{args[2]},#{args[3]})"
  end
end

- (self) runCommand(commandName, command, resultHandler) { ... }

Run an arbitrary MongoDB command.

Parameters:

  • commandName (String)
    the name of the command
  • command (Hash{String => Object})
    the command

Yields:

  • will be called with the result.

Returns:

  • (self)


982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 982

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

- (self) save(collection, document, resultHandler) { ... }

Save a document in the specified collection

This operation might change _id field of document parameter

Parameters:

  • collection (String)
    the collection
  • document (Hash{String => Object})
    the document

Yields:

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

Returns:

  • (self)


697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 697

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

- (self) saveWithOptions(collection, document, writeOption, resultHandler) { ... }

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

This operation might change _id field of document parameter

Parameters:

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

Yields:

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

Returns:

  • (self)


281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 281

def save_with_options(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Symbol && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),Java::IoVertxExtMongo::WriteOption.valueOf(args[2].to_s),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),Java::IoVertxExtMongo::WriteOption.valueOf(args[2].to_s),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling save_with_options(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (self) update(collection, query, update, resultHandler) { ... }

Update matching documents in the specified collection

Parameters:

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

Yields:

  • will be called when complete

Returns:

  • (self)


772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 772

def update(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Hash && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling update(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (self) updateCollection(collection, query, update, resultHandler) { ... }

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

Parameters:

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

Yields:

  • will be called when complete

Returns:

  • (self)


1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 1270

def update_collection(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Hash && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtMongo::MongoClientUpdateResult))
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling update_collection(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (self) updateCollectionWithOptions(collection, query, update, options, resultHandler) { ... }

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

Parameters:

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

Yields:

  • will be called when complete

Returns:

  • (self)


822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 822

def update_collection_with_options(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Hash && args[3].class == Hash && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),Java::IoVertxExtMongo::UpdateOptions.new(::Vertx::Util::Utils.to_json_object(args[3])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),Java::IoVertxExtMongo::UpdateOptions.new(::Vertx::Util::Utils.to_json_object(args[3])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtMongo::MongoClientUpdateResult))
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling update_collection_with_options(#{args[0]},#{args[1]},#{args[2]},#{args[3]})"
  end
end

- (self) updateWithOptions(collection, query, update, options, resultHandler) { ... }

Update matching documents in the specified collection, specifying options

Parameters:

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

Yields:

  • will be called when complete

Returns:

  • (self)


885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 885

def update_with_options(*args)
  if args[0].class == String && args[1].class == Hash && args[2].class == Hash && args[3].class == Hash && true
    if (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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),Java::IoVertxExtMongo::UpdateOptions.new(::Vertx::Util::Utils.to_json_object(args[3])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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(args[0],::Vertx::Util::Utils.to_json_object(args[1]),::Vertx::Util::Utils.to_json_object(args[2]),Java::IoVertxExtMongo::UpdateOptions.new(::Vertx::Util::Utils.to_json_object(args[3])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling update_with_options(#{args[0]},#{args[1]},#{args[2]},#{args[3]})"
  end
end