Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-1035

Bulk Operations incorrect format

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 12_01_17
    • Affects Version/s: 2.1.0
    • Component/s: Docs
    • Labels:
      None

      The documentation for 2.1.0 http://docs.mongodb.org/ecosystem/tutorial/ruby-driver-tutorial/#bulk-operations states that the correct format for the update_one operation is:

      { :update_one => { :filter => { :find => { :x => 1 }},
      :update => { '$set' => { :x => 2 } },
      :upsert => true } # upsert is optional and defaults to false
      }

      However this did not work for me... I had to use:

      { :update_one => { :filter => { :x => 1 },
      :update => { '$set' => { :x => 2 } },
      :upsert => true } # upsert is optional and defaults to false
      }

      that is remove the :find after the filter.
      I'm guessing this is also true for the other operation that use filter/find like replace_one, update_many...
      Probably this is a leftover from the previous version 2.0.0 which used :find instead of :filter.

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            clarkgr George L
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: