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?

    XMLWordPrintableJSON

Details

    • Icon: Question Question
    • Resolution: Done
    • Icon: Trivial - P5 Trivial - P5
    • None
    • None
    • None
    • None

    Description

      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']
      }

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: