Using the example of the tutorial (http://python-eve.org/features#embedded-resource-serialization):
DOMAIN = {
'emails': {
'schema': {
'author': {
'type': 'objectid',
'data_relation': {
'resource': 'users',
'field': '_id',
'embeddable': True
},
},
'subject': {'type': 'string'},
'body': {'type': 'string'},
}
}
Is it possible to query the emails of the author.name "Nicola Iarocci" for example? I tried
/emails?where={"author.name":"Nikola Iarocci"}&embbeded={"author":1}
but it doesn't work.
It works if the document is embedded, but not if it's declared as embeddable.
That is not possible as it is not supported by MongoDB itself. You might want to consider the Aggregation Framework, which is supported by Eve 0.7 (in development, but you can install it).