Mongodb字段自增长

            MongoClient client = new MongoClient("mongodb://xxx.xxx.x.xx:27017");
var mongServer = client.GetServer();
var db = mongServer.GetDatabase("db_test");
var dbclient = db.GetCollection("test"); FindAndModifyArgs arg=new FindAndModifyArgs();
arg.Query = Query.EQ("_id", new ObjectId("5a011a0d59f1654cdc377135"));
arg.Update = Update.Inc("Age", 1L);
arg.Upsert = true;
arg.VersionReturned=FindAndModifyDocumentVersion.Modified;
var result = dbclient.FindAndModify(arg);
var p = result.ModifiedDocument["Age"].AsInt64;
上一篇:移动端web开发中对点透的处理,以及理解fastclick如何做到去除300ms延迟


下一篇:mobx项目创建 + mobx项目流程代码