Created
November 15, 2011 20:47
-
-
Save esedor/1368293 to your computer and use it in GitHub Desktop.
Querying MongoDB in Node.JS
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
mongoose.connection.db.collection('quests', function(err, coll) { | |
coll.insert({'goal': 'Explore a new land', 'level': 1}); | |
coll.update({'goal': 'Explore a new land'}, | |
{'$set': {'reward.gold': 150}}); | |
coll.find({'level': {'$lte': 4}}).toArray(function (err, result) { | |
console.log(result); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment