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

Unique key constraints not enforced after dropDatabase()

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 2.6.6
    • Index Maintenance
    • None
    • ALL

    Description

      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.

      Attachments

        Activity

          People

            ramon.fernandez@mongodb.com Ramon Fernandez Marina
            carn1x Dan Helyar
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: