Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
Short example of node.js Express method to GET resource data from MongoDB. This was just a snippet for my blog to illustrate the simplicity of getting data from MongoDB. Assume the data has already been validated, and DynamoDB connection established.
resource.get (req, res) ->
collection.findOne _id:new mongodb.ObjectID, (error, object) =>
res.json 200, JSON.stringify object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.