如何在c#中为MongoDB构建更新查询 [英] How to build a update query in c# for MongoDB

查看:80
本文介绍了如何在c#中为MongoDB构建更新查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是应为其构建更新查询的临时数据

Here is a temp data for which a update query should be built

{
    "ID" : 2014,
    "Reason" : "Message",
    "Modules" : [ 
        "AA","BB","CC"
    ],
    "Script" : {
	"Title":"Hello"
        "Informational" : "Hi How are you"
    }
}





其中Modules []的大小可能不同而脚本下的Title是可选的。



where Modules[] may vary in size and Title under scripts is optional.

推荐答案

你可以看一下 C#-Driver [ ^ ]或此文章 [ ^ ]。
You maybe took a look at the C#-Driver[^] or this Article[^].


Check更新现有的文档 [ ^ ]。

尝试 http://docs.mongodb.org/ecosystem/tutorial/use-csharp-driver/ [ ^ ]。
Check out updating an existing document[^].
Try http://docs.mongodb.org/ecosystem/tutorial/use-csharp-driver/[^] as well.


这篇关于如何在c#中为MongoDB构建更新查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆