龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 数据库类 > nosql开发 >

Sql与NoSql语句对比编写

时间:2014-05-22 15:51来源:网络整理 作者:网络 点击:
分享到:
Select a, b from usersdb.users.find({},{a:1, b:1})查询表Select * from usersdb.users.find()查询表Select * from users where age=33db.users.find({age:33})条件查询Select a, b from users where age=33db.users.find({ .

Select a, b from users
db.users.find({},{a:1, b:1})
查询表
Select * from users
db.users.find()
查询表
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
db.users.find({'age':{$lt:33}})
条件查询
select * from users where age>33 and age<=40
db.users.find({'age':{$gt:33,$lte:40}})
条件查询
select * from users where a=1 and b='q'
db.users.find({a:1,b:'q'})
条件查询
select * from users where a=1 or b=2
db.users.find( { $or : [ { a : 1 } , { b : 2 } ] } )
条件查询
select * from users limit 1
db.users.findOne()
条件查询
select * from users where name like "%Joe%"
db.users.find({name:/Joe

精彩图集

赞助商链接