mongodb内部查询
我有一个格式的mongoDB文档。此处给出的阵列有多个集合。 我如何获得sid = 100的所有元素。
{
"_id" : "123456",
"Continent" : {
"Country" : [
[
US,
{
"State" : [
[
100,
{
"Product" : "Corn",
"SID" : 100
}
],
[
200,
{
"Product" : "Maze",
"SID" : 200
}
]
],
}
]
],
},
}
I have a mongodb document in this format. There are multiple collections of arrays as given here.
How do I get all elements where SID = 100.
{
"_id" : "123456",
"Continent" : {
"Country" : [
[
US,
{
"State" : [
[
100,
{
"Product" : "Corn",
"SID" : 100
}
],
[
200,
{
"Product" : "Maze",
"SID" : 200
}
]
],
}
]
],
},
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
选项1:
解释:
playground1
选项2:选项2:
(稍微更快)
解释:
playground2
Option 1:
Explained:
Playground1
Option 2:
( Slightly faster)
Explained:
Playground2