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

Allow wildcard indices with unique constraint

    • Query Optimization

      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.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            mitar NOVALUE Mitar
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: