A document with the following structure will crash MongoEngine 0.24.0
class MyDoc(Document):
fld = GenericReferenceField()
meta = {
"indexes": [{"fields": ["fld._ref.$id"]}]
}
This type of index was fine before, but now throws an error:
...
File ".../mongoengine/base/metaclasses.py", line 370, in __new__
meta["index_specs"] = new_class._build_index_specs(meta["indexes"])
File ".../mongoengine/base/document.py", line 848, in _build_index_specs
index_specs = [cls._build_index_spec(spec) for spec in meta_indexes]
File ".../mongoengine/base/document.py", line 848, in <listcomp>
index_specs = [cls._build_index_spec(spec) for spec in meta_indexes]
File ".../mongoengine/base/document.py", line 941, in _build_index_spec
fields = cls._lookup_field(parts)
File ".../mongoengine/base/document.py", line 1143, in _lookup_field
raise LookUpError(
mongoengine.errors.LookUpError: Cannot perform join in mongoDB: fld___ref__$id
A document with the following structure will crash MongoEngine 0.24.0
This type of index was fine before, but now throws an error: