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

copyDatabase() fails due to document validation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 3.3.15
    • Fix Version/s: None
    • Component/s: Usability
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide
      • Create a database
      • Create a collection with one structure
      • Define a validator on the collection that enforces a different structure, throwing an error if the structure is incorrect.
      • Add new documents that observe the new structure
      • Use the copyDatabase() to copy this database to a new location
      • This copy should fail due to validation
      Show
      Create a database Create a collection with one structure Define a validator on the collection that enforces a different structure, throwing an error if the structure is incorrect. Add new documents that observe the new structure Use the copyDatabase() to copy this database to a new location This copy should fail due to validation

      Description

      when calling the command db.copyDatabase() the command will fail if one of the documents in a collection fails document validation. This probably isn't a bug but it is undesirable behaviour. When requesting a copy of a database that is what I want, a copy, warts and all.

      In my case this problem comes about because in the early days of my database I didn't have document validation in place. Later on I put validation in place and enforced it strictly.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: