Shane
(Shane Harvey)
3
You can find the Image document that contains your label like this:
image = Image.objects(labels__id=label_id).first()
See 2.5. Querying the database — MongoEngine 0.27.0 documentation
You can also use the aggregation API directly as described here: 2.5. Querying the database — MongoEngine 0.27.0 documentation
I will also say it is unusual to add in _id on EmbeddedDocuments. An _id usually lives only at the top level document (or as a reference to another document, eg a ReferenceField).