原创-mongodb增删改查

查找admin集合下前10条数据:

db.admin.find().limit(10);

---

插入数据

> post={table: "activityzones",

...         fields: [

...             {

...                 name: "_id",

...                 type: "ObjectId",

...                 hidden: true

...             }]}

 

> db.admin.insert(post)

---

更新数据

post.comments=[]

db.admin.update({"table" : "appstore_accounts"},post)

---

删除数据

db.admin.remove("table" : "appstore_accounts")

原文地址:https://www.cnblogs.com/normanlin/p/13797488.html