0.4.3 • Published 9 years ago

restful-mongo v0.4.3

Weekly downloads
5
License
BSD
Repository
github
Last release
9 years ago

RESTful MongoDB

It allows you to setup an HTTP API server to access data stored on MongoDB, easily and quickly.

Install and setup an express server using restful-mongo

  • npm install -g express-generator
  • express mongo-express
  • cd mongo-express && npm install
  • npm install --save restful-mongo to install restful-mongo
  • add to app.js file, in the section where routes are configured, the following code
var RestfulMongo=require('restful-mongo');
new RestfulMongo({
    HOST:'localhost',   // host of mongodb server, OPTIONAL
    PORT:27017          // port of mongodb server, OPTIONAL  
}).configure(app);
  • npm start
  • access browser at http://localhost:3000/api/test/collectionName to read JSON documents of collection collectionName of database test1

Example of HTTP requests

You can do following requests:

GET /api/localhost:27017/test1/collections HTTP/1.1

Get list of collection names of test1 database

GET /api/localhost:27017/test1/books HTTP/1.1

Get all documents of collection books of test1 database

GET /api/localhost:27017/test1/books?rawQuery={author:{$in:['Manzoni']}} HTTP/1.1

Get all documents of collection books of test1 database whose author is Manzoni

Disclaimer

  • the code behind this module is very old, not so readable, and needs refactoring. Do not consider this code as code that I usually write.
0.4.3

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago

0.3.9

9 years ago

0.3.8

9 years ago

0.3.7

10 years ago

0.3.6

10 years ago

0.3.5

10 years ago

0.3.4

11 years ago

0.3.3

11 years ago

0.3.2

11 years ago

0.3.1

11 years ago

0.3.0

11 years ago

0.2.8

11 years ago

0.2.7

11 years ago

0.2.6

11 years ago

0.2.5

11 years ago

0.2.4

11 years ago

0.2.3

11 years ago

0.2.2

11 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.9

11 years ago

0.1.8

11 years ago

0.1.7

11 years ago

0.1.6

11 years ago

0.1.5

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.9

11 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago

0.0.0

11 years ago