Class: VertxMongo::MongoService

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

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from MongoClient

#aggregate, #aggregate_with_options, create_non_shared, create_shared, #distinct_batch, #distinct_batch_with_query, #find_batch, #find_batch_with_options

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


19
20
21
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 19

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

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

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

Parameters:

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

Returns:

Raises:

  • (ArgumentError)


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

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

+ (Object) DEFAULT_DB_NAME

The name of the default database


547
548
549
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 547

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

+ (Object) DEFAULT_POOL_NAME

The name of the default pool


543
544
545
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 543

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

+ (Object) j_api_type



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

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



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

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

+ (Object) unwrap(obj)



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

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

+ (Object) wrap(obj)



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

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

Instance Method Details

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


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

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


206
207
208
209
210
211
212
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 206

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

- (void) close

This method returns an undefined value.

Raises:

  • (ArgumentError)


536
537
538
539
540
541
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 536

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


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

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

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

Parameters:

  • collectionName (String) (defaults to: nil)

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


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_service.rb', line 429

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


459
460
461
462
463
464
465
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 459

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


471
472
473
474
475
476
477
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 471

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

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

Parameters:

  • collection (String) (defaults to: nil)
  • fieldName (String) (defaults to: nil)
  • resultClassname (String) (defaults to: nil)

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


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

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


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

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

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

Parameters:

  • collection (String) (defaults to: nil)

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


448
449
450
451
452
453
454
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 448

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


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

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


217
218
219
220
221
222
223
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 217

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


241
242
243
244
245
246
247
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 241

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


304
305
306
307
308
309
310
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 304

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


316
317
318
319
320
321
322
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 316

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


279
280
281
282
283
284
285
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 279

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


293
294
295
296
297
298
299
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 293

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


253
254
255
256
257
258
259
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 253

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


267
268
269
270
271
272
273
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 267

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


229
230
231
232
233
234
235
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 229

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

- (self) get_collections { ... }

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


438
439
440
441
442
443
444
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 438

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


71
72
73
74
75
76
77
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 71

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


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

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

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

Parameters:

  • collection (String) (defaults to: nil)

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


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

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


338
339
340
341
342
343
344
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 338

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


395
396
397
398
399
400
401
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 395

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


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

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


349
350
351
352
353
354
355
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 349

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


373
374
375
376
377
378
379
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 373

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


384
385
386
387
388
389
390
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 384

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


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

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


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

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


145
146
147
148
149
150
151
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 145

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


157
158
159
160
161
162
163
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 157

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


183
184
185
186
187
188
189
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 183

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


170
171
172
173
174
175
176
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 170

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


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

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


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

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


60
61
62
63
64
65
66
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 60

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


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

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


107
108
109
110
111
112
113
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 107

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


133
134
135
136
137
138
139
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 133

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

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

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


120
121
122
123
124
125
126
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mongo/mongo_service.rb', line 120

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