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)


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

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:



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

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:



920
921
922
923
924
925
926
927
928
929
930
931
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 920

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


1248
1249
1250
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 1248

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

+ (Object) DEFAULT_POOL_NAME

The name of the default pool


1244
1245
1246
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 1244

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

+ (Object) j_api_type



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

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



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

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

+ (Object) unwrap(obj)



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

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

+ (Object) wrap(obj)



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

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:



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

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:



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

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)


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

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)


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

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


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

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)


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

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)


579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 579

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


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

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)


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

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)


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

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)


678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 678

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:



521
522
523
524
525
526
527
528
529
530
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 521

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:



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

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)


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

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)


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

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)


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

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)


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

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:



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

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:



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

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)


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

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)


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

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)


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

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)


704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 704

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)


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

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)


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

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)


869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 869

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)


893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 893

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)


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

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)


753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 753

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)


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

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)


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

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)


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

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)


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

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)


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

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)


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

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)


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


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

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)


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

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)


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

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)


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

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)


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

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)


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

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)


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

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)


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

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)


653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 653

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)


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

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)


728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 728

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)


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

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)


778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_client.rb', line 778

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)


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

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