Class: VertxMongo::MongoService

Inherits:
MongoClient
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb

Overview

@author Tim Fox

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (::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)


22
23
24
25
26
27
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 22

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

Instance Method Details

- (void) close

This method returns an undefined value.

Raises:

  • (ArgumentError)


256
257
258
259
260
261
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 256

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)


163
164
165
166
167
168
169
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 163

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)


219
220
221
222
223
224
225
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 219

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) drop_collection(collection = nil) { ... }

Parameters:

  • collection (String) (defaults to: nil)

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


238
239
240
241
242
243
244
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 238

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) find(collection = nil, query = nil) { ... }

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


128
129
130
131
132
133
134
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 128

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)


152
153
154
155
156
157
158
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 152

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


140
141
142
143
144
145
146
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 140

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)


228
229
230
231
232
233
234
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 228

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)


55
56
57
58
59
60
61
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 55

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)


67
68
69
70
71
72
73
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 67

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),(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) remove(collection = nil, query = nil) { ... }

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


174
175
176
177
178
179
180
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 174

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_one(collection = nil, query = nil) { ... }

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


197
198
199
200
201
202
203
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 197

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)


209
210
211
212
213
214
215
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 209

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


186
187
188
189
190
191
192
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 186

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


104
105
106
107
108
109
110
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 104

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


117
118
119
120
121
122
123
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 117

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(command = nil) { ... }

Parameters:

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

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


248
249
250
251
252
253
254
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 248

def run_command(command=nil)
  if command.class == Hash && block_given?
    @j_del.java_method(:runCommand, [Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(::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(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)


32
33
34
35
36
37
38
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 32

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)


44
45
46
47
48
49
50
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 44

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


79
80
81
82
83
84
85
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 79

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


92
93
94
95
96
97
98
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mongo-client/vertx-mongo-service/src/main/resources/vertx-mongo/mongo_service.rb', line 92

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