Created
May 6, 2015 22:59
-
-
Save cahlan/46c02a426ff82910ca15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongojs = require('mongojs'); | |
var db = mongojs('test'); | |
var users = db.collection('users'); | |
//find all | |
// users.find(function(err, users) { | |
// console.log(err, users); | |
// }); | |
//insert | |
// users.insert({name:'Jane', age:34, status:'inactive'}, function(err, new_user) { | |
// console.log(err, new_user); | |
// }); | |
//find with more advanced operators | |
// users.find({age:{$gt:20}}, function(err, users) { | |
// console.log(users); | |
// }) | |
//count | |
// users.count({age:{$gt:20}}, function(err, users) { | |
// console.log(users); | |
// }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment