Tag Archives: select

Mongo: select data

1
2
> db.communities.find({name: "CZ CHAT"}, {"name":1, "_id":0, "communityId":1}).sort({"communityId":1}).pretty().limit(5)
{ "communityId" : NumberLong("468374361246531951"), "name" : "CZ CHAT" }

in sql it looks like:

1
select name, "communityId" from communities where name like 'CZ CHAT' order by "communityId" limit 5;

pretty () — just a formatted output.