A RESTful Interface to MongoDB.
This is an experimental project that I hacked up in about 4 hours. It is no where near even beta quality code. I hope to have time to flesh this out more later.
Future Plans:
- Accept json input from raw body
- API key based authentication
- A more robust query interface
- Content Negotiation to also support xml, serialized php, and html output based on accept headers and url file extensions.
- Cross Origin support
- Unit Tests
- Better Documentation
- Apache
- mod_rewrite
- PHP
- PHP 5.3+
- json extension
- MongoDb
Just drop or clone entire project into your DOCUMENT_ROOT.
GET /dbs - List all databases on the server
GET /:db - Will list all collections belonging to :db
E.g.
/blog
GET /:db/:collection
E.g.
/blog/posts
/blog/posts?limit=10&skip=0
/blog/posts?limit=10&skip=10&author=bob&category=php
Arguments:
- skip
- limit
Any additional arguments will be treated as AND query parameters
PUT /:db/:collection
The data to be entered into the collection must be sent as request parameters. The content-type must be:
application/x-www-form-urlencoded
POST /:db/:collection/:id
The data to be entered into the collection must be sent as request parameters. The content-type must be:
application/x-www-form-urlencoded
DELETE /:db/:collection/:id