Method: Moped::Session::Context#update

Defined in:
lib/moped/session/context.rb

#update(database, collection, selector, change, options = {}) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/moped/session/context.rb', line 68

def update(database, collection, selector, change, options = {})
  with_node do |node|
    if safe?
      node.pipeline do
        node.update(database, collection, selector, change, options)
        node.command("admin", { getlasterror: 1 }.merge(safety))
      end
    else
      node.update(database, collection, selector, change, options)
    end
  end
end