Powerful REST and Web Sockets API for MongoDB collections using Mongoose and Express.
- Expects: Object passed to event listener with document to save
- Emits:
api.collection-name.save.response
orapi.collection-name.save.error
- Expects: Object passed to event listener with collection query, may include proprietary fields
limit
,page
,sort
andprojection
. If finding byObjectId
you can useid
or_id
property. - Emits:
api.collection-name.find.response
orapi.collection-name.find.error
- Expects: Object passed to event listener with id and document updates to make, expects
id
or_id
property in object with valid documentObjectId
. For bulk updates a_query
parameter can be supplied with the query specifics to match documents against. - Emits:
api.collection-name.update.response
orapi.collection-name.update.error
- Expects: Object passed to event listener with query for delete to make. If deleting by
ObjectId
you can useid
or_id
property. - Emits:
api.collection-name.remove.delete
orapi.collection-name.remove.delete
- Valid Route and Method: Yes
- Purpose: Returns all documents from the collection
- Supports Query Parameters: This route does support query parameters to influence the document result set.
- Valid Route and Method: Yes
- Purpose: Returns all documents from the collection, fields returned are limited to the comma separated values included in the projection value
- Supports Query Parameters: This route does support query parameters to influence the document result set.
- Valid Route and Method: Yes
- Purpose: Returns specific document from the collection based on it's _id
- Supports Query Parameters: This route does not support query parameters.
- Valid Route and Method: Yes
- Purpose: Returns specific document from the collection based on it's _id, fields returned are limited to the comma separated values included in the projection value
- Supports Query Parameters: This route does not support query parameters.
- Valid Route and Method: Yes
- Purpose: Adds a new document to the collection.
- Supports Query Parameters: This route does support some parameters to influence the document creation, they will be merged with the values POSTed to the request body with POSTed values taking a higher precedence.
- Valid Route and Method: No
- Purpose: Not supported, error message returned.
- Valid Route and Method: No
- Purpose: Not supported, error message returned.
- Valid Route and Method: Yes
- Purpose: Bulk update of documents matching query formed from GET parameters
- Supports Query Parameters: Yes, these are used in forming the query to matching the documents to update. The PUT body will be the document updates.
- Valid Route and Method: Yes
- Purpose: Updates a new document by _id within the collection.
- Supports Query Parameters: This route does support some parameters to influence the document update, they will be merged with the body of POST, with POST values taking a higher precedence.
- Valid Route and Method: No
- Purpose: Not supported, error message returned.
- Valid Route and Method: Yes
- Purpose: Deletes all documents within the collection matching query, be careful you can delete all documents if no query is supplied!
- Supports Query Parameters: This route does support some parameters to influence the document deleting, they will be merged with the body of the DELETE request with DELETE values taking a higher precedence.
- Valid Route and Method: Yes
- Purpose: Deletes a specific document from the collection based on it's _id
- Supports Query Parameters: This route does not support query parameters.
- Valid Route and Method: No
- Purpose: Not supported, error message returned.