public
Last active

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.

  • Download Gist
express-mongodb-get
1 2 3
resource.get (req, res) ->
collection.findOne _id:new mongodb.ObjectID req.body.id, (error, object) =>
res.json 200, JSON.stringify object

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.