ltonetwork / mongodb-rest

JSON REST server for MongoDB (using node.js)
MIT License
405 stars 143 forks source link

CURL Example Code #21

Closed EdwardMGoldberg closed 12 years ago

EdwardMGoldberg commented 12 years ago

After reading the code I learned how to use the CURL command to use the REST interface:

curl -d '{ "A1" : 201 }' -H "Content-Type: application/json" http://localhost:3000/test/example1

Value Added to the "test" db.example1 collection: { "A1": 201, "_id": ObjectId("4e90e196b0c7f4687000000e") }

You may want to add this example the the Introduction to help explain the exact use the code.

This comes from the header of the file:

/mongodb-rest/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js

This was a great help to me in testing my new code.

tdegrunt commented 12 years ago

I've added it to the README, thanks!