【发布时间】:2021-09-24 03:17:29
【问题描述】:
我想弄清楚如何搜索标签为“작성”且值为“Y”的对象数组
我做了这样的查找查询{"attrs.label": "작성" , "attrs.value": "Y"}
但问题是
{..., attrs: [{label: "작성", value: "N"}, {label: "Another", value: "Y"}]}
此文档与我的查询匹配,我需要在一个数组元素中完全匹配。
我试过了
{ $and: [{"attrs.label": /작성/}, {"attrs.value": "Y"}]}
【问题讨论】:
标签: database mongodb mongoose mongodb-query