-
Type: New Feature
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Querying
-
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.