在MongoDB的10gen公司的司机使用MongoDB的shell命令司机、命令、公司、MongoDB

由网友(孤心)分享简介:我想简单地通过MongoDB的10gen公司的.NET执行纯粹的MongoDB查询(C#)的驱动程序。I want to simply execute pure MongoDB queries via MongoDb 10Gen's .net(c#) driver.例如。我想在驱动程序使用下面的命令For ex...

我想简单地通过MongoDB的10gen公司的.NET执行纯粹的MongoDB查询(C#)的驱动程序。

I want to simply execute pure MongoDB queries via MongoDb 10Gen's .net(c#) driver.

例如。我想在驱动程序使用下面的命令

For example . I want to use below command on driver

db.people.update( { name:"Joe" }, { $inc: { n : 1 } } );

我不知道我怎么能做到这一点。我不感兴趣,如何通过高层次的API类做的。

I am not sure how can i do this. I am not interested in how to do via high level api classes.

推荐答案

C#的驱动程序(或任何其他驱动程序),不适合在直接蒙戈运行shell命令。这就是shell是什么。你需要做的是翻译蒙戈shell命令成等价的C#语句。

The C# driver (or any other driver) is not intended to "directly" run mongo shell commands. That's what the shell is for. What you need to do is translate the mongo shell commands into the equivalent C# statements.

如果你想运行蒙戈shell命令,然后在蒙戈shell中运行它们。

If you want to run mongo shell commands then run them in the mongo shell.

阅读全文

相关推荐

最新文章