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

Allow wildcard indices with unique constraint

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Investigating
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Querying
    • Labels:
      None

      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

            Assignee:
            kateryna.kamenieva Katya Kamenieva
            Reporter:
            mitar Mitar
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated: