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)


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

def @@j_api_type.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:



591
592
593
594
595
596
597
598
599
600
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 591

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:



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

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


1104
1105
1106
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 1104

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

+ (Object) DEFAULT_POOL_NAME

The name of the default pool


1100
1101
1102
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 1100

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

+ (Object) j_api_type



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

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



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

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

+ (Object) unwrap(obj)



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

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

+ (Object) wrap(obj)



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

def @@j_api_type.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:



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

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:



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

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)


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

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)


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

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

This method returns an undefined value.

Close the client and release its resources

Yields:



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

def close
  if true
    if (block_given?)
      return @j_del.java_method(:close, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:close, [Java::IoVertxCore::Handler.java_class]).call(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 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)


711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 711

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)


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

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)


688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 688

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)


994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 994

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)


836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 836

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)


234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 234

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)


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

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)


138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 138

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:



933
934
935
936
937
938
939
940
941
942
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 933

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:



378
379
380
381
382
383
384
385
386
387
388
389
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 378

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)


500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 500

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)


948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 948

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)


346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 346

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)


474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 474

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:



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

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:



1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 1018

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)


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

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)


908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 908

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)


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

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)


185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 185

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)


765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 765

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)


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

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)


427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 427

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)


451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 451

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)


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

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)


210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 210

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)


737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 737

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)


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

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


813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 813

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)


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

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)


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

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)


667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 667

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


569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 569

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)


790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 790

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


545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 545

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)


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

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)


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

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


972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 972

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)


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

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