Skip to content

poqbox/mongoose-web-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mongoose-web-api

A mongoose-based web API for manipulating MongoDB databases.

Setup

  1. In Git Bash, install the necessary modules with:
    npm install

  2. In the project folder, create a file named .env. The contents of this file should look like this:

MONGO_URI = 

Under MONGO_URI, put your MongoDB cluster's connection string. This can be found on the MongoDB website.

HTTP Methods

GET

`/api/collections`

GET Returns a list of collections in the current database.

  • Responses
    • 200: JSON object

`/api/sandbox`

GET Returns a list of documents in the Sandboxes collection.

  • Request body (optional)

    Accepts a MongoDB query

  • Query parameters (optional)

    Prioritizes the request body
    id: ID of the document.
    name: Name of the document.


`/api/sandbox/:id`

GET Returns a document in the Sandboxes collection.

  • Route parameters (Required)

    id: ID of the document.



POST

`/api/sandbox`


PATCH

`/api/sandbox/:id`


PUT

`/api/switch_database/:database`
  • Route parameters (Required)

    database: Name of the database to switch to

  • Responses
    • 200: JSON


DELETE

`/api/sandbox/:id`


About

A mongoose-based web API for manipulating MongoDB databases.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published