我有一个Mongo Collection,其中包含带有多个字段的文档。我想通过在列表中按行匹配所有字段来进行过滤。
[
{"field1": "value11", "field2": "value12"},
{"field1": "value21", "field2": "value22"},
{"field1": "value31", "field2": "value32"}
]
我要在spring数据中创建的语句如下:
select * from collection
where (field1=value1 AND field2=value2)
OR (field1=value21 AND field2=value3)
...
OR (field1=valueN AND field2=valueX)