Environment:
python: 3.8
mongodb: 3.4 (on docker container)
mongoengine: 0.20.0
One collection in mongodb, DEVICE, with 104 documents populated. There are 9 ReferenceField attributes in the DEVICE collection. The total size of documents from referenced fields are much larger than each DEVICE doc itself.
If I test the performance of the following query,
1. Device.objects(name=name).first()
2. Device.objects(name=name).no_dereference().first()
no matter the test is on the mongodb host or from a remote host, the performance of the first statement is so much better than the second statement.
Wondering why the second statement performance is so much worse than the first statement. What does no_dereference() call actuall do? What's the general guideline on when to use, and when not to use the no_dereference() call?
thanks