我想检索所有电影的名称及其类型。如果关于流派的信息是空的,那就没关系,但是如果已知流派,我想要检索它。
"/film/film/genre": [{"id":null,"optional":"optional"}]
但我对同性恋色情内容不感兴趣,所以我想排除所有类型为“/ en / gay_pornography”的电影。
"/film/film/genre": [{"id|=":["/en/gay_pornography"],"optional":"forbidden"}]
问题是,如何在一个查询中组合它?即如何获得所有电影,甚至那些没有类型并排除pr0n的电影?
编辑:需要排除多种类型,例如还是/ en / pornographic_movie
答案 0 :(得分:4)
你基本上就在那里:你只需要两个“流派”条款。 MQL允许您通过在任何子句上允许任意前缀来执行此操作:
[{ "id": null, "type": "/film/film", "genre": [{ "id": null, "optional": true }], "forbid:genre": { "id|=": [ "/en/gay_pornography", "/en/pornographic_movie" ], "optional": "forbidden" } }]
答案 1 :(得分:0)
使用"but not"运算符:
"genre": [{
"id": null,
"id!=": "/en/gay_pornography",
"optional": true
}]
完整示例:http://tinyurl.com/3tjdb4j
编辑:这不回答问题。它只是阻止特定的id被列为电影类型,但不禁止电影。 @ phillip-kendal的回答是正确的。