Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-11825

does $addToSet cause index to be rebuilt even when document didn't change?

    • Type: Icon: Question Question
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      i would like to know if performing an $addToSet on an indexed field would cause an index on this field to be rebuilt even if there is no actual change to the field?

      for example, if one performed update({ $addToSet:

      { 'list': 'b' }

      }) on such a document:
      {
      _id: 1
      'list': ['a', 'b', 'c']
      }

            Assignee:
            Unassigned Unassigned
            Reporter:
            pcmaniac Nemanja Dubravac
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: