日期:2014-05-16  浏览次数:20413 次

mongodb 3

?

作用 SQL mongdb

所有记录

SELECT * FROM users

db.users.find()

age=33的记录

SELECT * FROM users WHERE age=33

db.users.find({age:33})

子键(字段)筛选

SELECT a, b FROM users WHERE age=33

db.users.find({age:33}, {a:1,b:1})

排序

SELECT * FROM users WHERE age=33 ORDER BY name