Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major - P3 Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.1.1
    • Fix Version/s: 2.4.0-rc1
    • Component/s: Write Ops
    • Labels:
      None
    • # Replies:
      29
    • Last comment by Customer:
      true
    • Documentation changes needed?:
      Done

      Description

      This will set the fields specified in $setOnInsert:

      {<fields>}

      if the update results in an insert. It does nothing if any existing documents are updated.

        Issue Links

          Activity

          Hide
          auto
          added a comment -

          Author:

          {u'date': u'2012-12-12T16:46:47Z', u'email': u'alerner@10gen.com', u'name': u'Alberto Lerner'}

          Message: SERVER-340 Created a $setOnInsert update operator.
          Branch: master
          https://github.com/mongodb/mongo/commit/ac3f20c6dcb8aeaa9ae7182816ab1dc4f15619f5

          Show
          auto
          added a comment - Author: {u'date': u'2012-12-12T16:46:47Z', u'email': u'alerner@10gen.com', u'name': u'Alberto Lerner'} Message: SERVER-340 Created a $setOnInsert update operator. Branch: master https://github.com/mongodb/mongo/commit/ac3f20c6dcb8aeaa9ae7182816ab1dc4f15619f5
          Hide
          Alberto Lerner (Inactive)
          added a comment -

          Already discussed documentation needs with Sam.

          Show
          Alberto Lerner (Inactive)
          added a comment - Already discussed documentation needs with Sam.
          Hide
          Scott Hernandez
          added a comment -

          The implementation in 2.3.2 is actually what "$setIfAbsent" should be and not the correct behavior of $setOnInsert.

          Show
          Scott Hernandez
          added a comment - The implementation in 2.3.2 is actually what "$setIfAbsent" should be and not the correct behavior of $setOnInsert.
          Hide
          auto
          added a comment -

          Author:

          {u'date': u'2013-02-07T21:53:24Z', u'email': u'alerner@10gen.com', u'name': u'Alberto Lerner'}

          Message: SERVER-340 $setOnInsert should be a no-op in an update.
          Branch: master
          https://github.com/mongodb/mongo/commit/52858af695150e71ca17f06e10c07419d54af42b

          Show
          auto
          added a comment - Author: {u'date': u'2013-02-07T21:53:24Z', u'email': u'alerner@10gen.com', u'name': u'Alberto Lerner'} Message: SERVER-340 $setOnInsert should be a no-op in an update. Branch: master https://github.com/mongodb/mongo/commit/52858af695150e71ca17f06e10c07419d54af42b
          Hide
          Nik Shornikov
          added a comment -

          @Scott Nichol +1

          Show
          Nik Shornikov
          added a comment - @Scott Nichol +1

            People

            • Votes:
              65 Vote for this issue
              Watchers:
              49 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                1 year, 7 weeks, 3 days ago
                Date of 1st Reply: