Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mongodb-rest

Package Overview
Dependencies
Maintainers
0
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongodb-rest

REST API Server for MongoDB

  • 0.8.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
44
decreased by-22.81%
Maintainers
0
Weekly downloads
 
Created
Source

Name

mongodb-rest - REST server for MongoDB

Description

This is a REST server for MongoDB using Node, using the native node.js MongoDB driver.

Major update, now using Express

Installation

Installation is now via npm: npm install mongodb-rest. After that you can just issue mongodb-rest on the command line and the server should start.

Notes

Supported REST requests:

  • GET /db/collection - Returns all documents
  • GET /db/collection?query=%7B%22isDone%22%3A%20false%7D - Returns all documents satisfying query
  • GET /db/collection?query=%7B%22isDone%22%3A%20false%7D&limit=2&skip=2 - Ability to add options to query (limit, skip, etc)
  • GET /db/collection/id - Returns document with id
  • POST /db/collection - Insert new document in collection (document in POST body)
  • PUT /db/collection/id - Update document with id (updated document in PUT body)
  • DELETE /db/collection/id - Delete document with id

Flavors:

  • Setup "sproutcore" as flavor, it will then change _id as returned by MongoDB into guid, as used by SproutCore, this allows for simpler DataSources.

Content Type:

  • Please make sure application/json is used as Content-Type when using POST/PUT with request body's.

Dependencies:

  • Are all indicated in package.json. So far I indicate the lowest version with which I tested the code. Sadly this can result in non-working code when later versions are used.

Testing

Testing is now done using expresso. Just run the following in the main folder: expresso -s test/create.test.js test/delete.test.js test/update.test.js The SproutCore test needs to be run separately at the moment.

Future

  • REST - PUT /db/collection - Update whole collection with changes in PUT body
  • Other useful commands (quit, reconnect, addUser, removeUser, etc)

Credits

  • MongoDB Driver
  • Express
  • npm

Keywords

FAQs

Package last updated on 11 Apr 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc