【发布时间】:2018-09-25 12:27:45
【问题描述】:
{ "_id": "111de970-4f3f-4ae6-9d3b-396e60ff50aa", "ClaimNumber": 111, "Details": [ { "Amount": "100", "Types": [ { "InvoiceType": "OO", "Status": "N" }, { "InvoiceType": "PP", "Status": "N" } ] }, { "Amount": "100", "Types": [ { "InvoiceType": "OO", "Status": "N" }, { "InvoiceType": "SS", "Status": "N" } ] } ] }
public class Type
{
public string InvoiceType { get; set; }
public string Status { get; set; }
}
public class Detail
{
public string Amount { get; set; }
public List<Type> Types { get; set; }
}
public class RootObject
{
public string _id { get; set; }
public int ClaimNumber { get; set; }
public List<Detail> Details { get; set; }
}
我想在“_id”列和“Types.InvoiceType”时更新Details数组中Types数组“Status”=“P”的值= "OO" 值匹配。
请提供一个示例,说明如何在 c# 中使用 mongo 驱动程序实现。
【问题讨论】:
标签: c# arrays mongodb document