Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-2910

Upgrade instructions for 2.6 should warn about new behavior of ensureIndex

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • v1.3.2
    • Affects Version/s: None
    • Component/s: manual

      Many application frameworks perform the following action on startup: for every model object in the application, verify that the necessary indexes are in place by calling ensureIndex for each associated index.

      Prior to 2.6 ensureIndex was (annoyingly) forgiving. If you had previously defined the an index foo to be name,1 and then later you changed your code and defined it as username,1, when you re-ensured the index it would just silently do nothing.

      The 2.6 version of ensureIndex is stricter (yay!). However, this may cause many application developers off guard when doing the upgrade. If they have any indexes in their dbs that are not in tune with the ensureIndex commands executed by their framework, their applications will fail to start up. The previous forgiving nature of ensureIndex will unfortunately make this a common issue.

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            cailin.nelson@mongodb.com Cailin Nelson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              10 years, 7 weeks, 3 days ago