This file contains 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
resource.get (req, res) -> | |
collection.findOne _id:new mongodb.ObjectID req.body.id, (error, object) => | |
res.json 200, JSON.stringify object |
This file contains 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
resource.post (req, res) -> | |
collection.insert req.body, safe:true, (error, data) -> | |
if !error? | |
res.end 201 |
This file contains 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
resource.post (req, res) -> | |
params = | |
TableName: 'TableName' | |
Item: | |
'id': | |
S: req.body.id | |
'color': | |
S: req.body.color | |
'tags': | |
SS: req.body.tags |