lib/plucky/query.rb in plucky-0.4.0 vs lib/plucky/query.rb in plucky-0.4.1
- old
+ new
@@ -6,11 +6,12 @@
extend Forwardable
OptionKeys = [
:select, :offset, :order, # MM
:fields, :skip, :limit, :sort, :hint, :snapshot, # Ruby Driver
- :batch_size, :timeout, :transformer # Ruby Driver
+ :batch_size, :timeout, :transformer, # Ruby Driver
+ :max_scan, :show_disk_loc, :return_key, # Ruby Driver
]
attr_reader :criteria, :options, :collection
def_delegator :criteria, :simple?
def_delegator :options, :fields?
@@ -83,12 +84,17 @@
def each
find_each.each { |doc| yield(doc) }
end
- def remove(opts={})
+ def remove(opts={}, driver_opts={})
query = clone.amend(opts)
- query.collection.remove(query.criteria.to_hash)
+ query.collection.remove(query.criteria.to_hash, driver_opts)
+ end
+
+ def update(document, driver_opts={})
+ query = clone
+ query.collection.update(query.criteria.to_hash, document, driver_opts)
end
def count(opts={})
find_each(opts).count
end
\ No newline at end of file