【发布时间】:2019-07-18 13:56:46
【问题描述】:
例如,我在下面有一个收集 = 交付的文档:
{
"doc": [
{
"docid": "15",
"deliverynum": "123",
"text": "txxxxxx",
"date": "2019-07-18T12:37:58Z"
},
{
"docid": "16",
"deliverynum": "456",
"text": "txxxxxx",
"date": "2019-07-18T12:37:58Z"
},
{
"docid": "17",
"deliverynum": "999",
"text": "txxxxxx",
"date": "2019-07-18T12:37:58Z"
}
],
"id": "123",
"cancelled": false
}
是否可以使用 "deliverynum" = 999 进行搜索,输出如下所示?
{
"doc": [
{
"docid": "17",
"deliverynum": "999",
"text": "txxxxxx",
"date": "2019-07-18T12:37:58Z"
}
],
"id": "123",
"cancelled": false
}
或者我应该为 Doc 部分制作另一个 Collection?
我无法在 C# 中针对这种情况进行查询。
【问题讨论】:
-
您希望
doc是一个数组还是一个普通文档? -
@RakshithSm 它是一个数组对象是的。 1 个交付 ID = 许多文档
标签: c# mongodb mongodb-.net-driver aws-documentdb