A mongoose-based web API for manipulating MongoDB databases.
-
In Git Bash, install the necessary modules with:
npm install
-
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.
`/api/collections`
- Responses
200
: JSON object
`/api/sandbox`
- 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`
- Route parameters (Required)
id
: ID of the document.
`/api/sandbox`
`/api/sandbox/:id`
`/api/switch_database/:database`
- Route parameters (Required)
database
: Name of the database to switch to - Responses
200
: JSON