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

Foreign Key Constraint on field

    XMLWordPrintable

Details

    • New Feature
    • Status: Backlog
    • Major - P3
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      I have been working with MongoDB for quite some time and I find that with the proper schema design, it can fit most generic use cases.

      However there are cases where referencing between collections (SQL like) is unavoidable. In these cases, the biggest drawback with Mongo compared to SQL DBs is  the foreign key constraint inability.

      Even checking using application logic, isn't 100% correct, since if you check for the validity of the field value before inserting the document, you can't be sure that it wasn't deleted when you create it and you have to check after creation and apply compensating deletion - error handling.

      I believe an index functionality where it would assert the existence of the field's value in an other's collection index  would be extremely helpful and remove this major drawback of Mongo compared to sequential databases,  since the check in the database level would allow for proper foreign key constraint.

      Tried to find similar issues - feature requests but didn't find any, that's why I created this one.

      Any thoughs on that?

      Attachments

        Activity

          People

            backlog-query-execution Backlog - Query Execution
            dimitris_ha@hotmail.com Dimitris Halatsis
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: