0
我在我的mongodb集合中收集了新闻。Spring Boot MongoDB通过列表中的值查找记录
{
"_id" : ObjectId("593a97cdb17cc6535522d16a"),
"title" : "Title",
"text" : "Test",
"data" : "9.06.2017, 14:39:33",
"author" : "Admin",
"categoryList" : [
{
"_id" : null,
"text" : "category1"
},
{
"_id" : null,
"text" : "category2"
},
{
"_id" : null,
"text" : "category3"
}
]
}
每个新闻记录都有类别列表。我很想找到所有有category1
的新闻categoryList
我试着做到这一点 newsRepository.findByCategoryList("category1");
但不工作。
如何做到这一点?