是否可以查询嵌入式文档?

时间:2016-11-11 12:30:51

标签: eve

使用教程示例(http://python-eve.org/features#embedded-resource-serialization):

rhc port-forward -a webapp

是否可以查询author.name" Nicola Iarocci"的电子邮件。例如?我试过了

DOMAIN = {
 'emails': {
     'schema': {
         'author': {
             'type': 'objectid',
             'data_relation': {
                 'resource': 'users',
                 'field': '_id',
                 'embeddable': True
             },
         },
         'subject': {'type': 'string'},
         'body': {'type': 'string'},
     }
 }

但它没有用。

如果文档是嵌入的,它可以工作,但如果它被声明为可嵌入则不行。

1 个答案:

答案 0 :(得分:0)

这是不可能的,因为MongoDB本身不支持它。您可能需要考虑Eve 0.7支持的聚合框架(在开发中,但您可以安装它)。

相关问题