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

Bulk Operations incorrect format

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 12_01_17
    • Component/s: Documentation
    • Labels:
      None

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: