我有这样的文件结构:
{
"_id" : "4e76fd1e927e1c9127d1d2e8",
"name" : "***",
"embedPhoneList" : [
{
"type" : "家庭",
"number" : "00000000000"
},
{
"type" : "手机",
"number" : "00000000000"
}
],
"embedAddrList" : [
{
"type" : "家庭",
"addr" : "山东省诸城市***"
},
{
"type" : "工作",
"addr" : "深圳市南山区***"
}
],
"embedEmailList" : [
{
"email" : "********@gmail.com"
},
{
"email" : "********@gmail.com"
},
{
"email" : "********@gmail.com"
},
{
"email" : "********@gmail.com"
}
]
}
我要做的是通过它的子文档找到该文档,例如email
字段中的embedEmailList
。
或者,如果我有这样的结构
{
"_id" : "4e76fd1e927e1c9127d1d2e8",
"name" : "***",
"embedEmailList" : [
"123@gmail.com" ,
"********@gmail.com" ,
]
}
embedEmailList
是数组,如何找到123@gmail.com
?
感谢。