2013年8月2日 星期五
2011年12月8日 星期四
[MongoDB] update one field of all records 更新所有資料裡的某個欄位
Usage:
db.collection.update( criteria, objNew, upsert, multi )
MongoDB shell:
MongoDB shell:
> db.users.update({}, {$set : { subscribe : true }}, false, true)
[MongoDB] print one field of all record 列出所有資料裡的某個欄位
MongoDB Shell:
> db.users.find({}, {email:1}).forEach(function(u) {print(u.email)})
訂閱:
文章 (Atom)