Unique key constraints not enforced after dropDatabase()

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.6.6
    • Component/s: Index Maintenance
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      I have a Node project with WebDriver test suite that runs 'mongo [database] --eval "db.dropDatabase();"' before each test run.

      One of the tests attempts to create a duplicate record to test a

      {unique : true}

      constraint, however the record is saved no problem. The schema is defined by Mongoose.

      The same test gives duplicate key error if I don't run dropDatabase() beforehand.

            Assignee:
            Ramon Fernandez Marina
            Reporter:
            Dan Helyar
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: