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

Allow wildcard indices with unique constraint

    XMLWordPrintable

Details

    • New Feature
    • Status: Investigating
    • Major - P3
    • Resolution: Unresolved
    • None
    • None
    • Querying

    Description

      We are storing documents where users can provide extra metadata. One case of this extra metadata are IDs in their own systems for those documents. This is then used to sync data between multiple systems when federating. For example, document can be like:

       

      {
       
        _id: <MongoDB ID>
       
        ids: {
          system1: "abc",
          system2: 123
        }
       
      }
      

      We would like to use wildcard index on "ids" field, but also require that any value for any field with same name inside the field has to be unique. For the example above, there should be no other document which has for "system1" field value equal to "abc".

      The issue is that we do not know in advance field names inside "ids" and different users might have different field names.

      Attachments

        Activity

          People

            kateryna.kamenieva@mongodb.com Katya Kamenieva
            mitar Mitar
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: