Skip to content
David Joseph edited this page Nov 11, 2021 · 1 revision

Used to handle the response when a request is made to a route.

Options

Required

model: A mongoose.model indicating the resource for CRUD operations to be performed.

modelName: A string representing the extended URL at which the resource can be accessed.

Optional

service: An instance of a custom Service. Uses the default service if not specified.

Functions

createResource: Used to create a new resource for the given model.

getOneById: Used to fetch a single document by it's _id.

updateOneById: Used to update a single document by it's _id.

deleteById: Used to delete a single document by it's _id.

Clone this wiki locally