paint-brush
Abstracting mongoose CRUD operations into a shared fileby@luukgruijs
1,871 reads
1,871 reads

Abstracting mongoose CRUD operations into a shared file

by Luuk Gruijs2mOctober 14th, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

When building an <a href="https://hackernoon.com/tagged/api" target="_blank">API</a> with <a href="https://hackernoon.com/tagged/node" target="_blank">Node</a>, Express and MongoDB you can choose Mongoose as your ODM. Mongoose helps you to easily do CRUD operations. When your API grows, usually the amount of models grow and therefore also the amount of express routes grow. In a lot of cases those routes just do simple create, read, update or delete operations. If those routes do not contain any other logic it would be nice if we can just forward the request to a reusable shared function which takes care of the request, right?

Company Mentioned

Mention Thumbnail
featured image - Abstracting mongoose CRUD operations into a shared file
Luuk Gruijs HackerNoon profile picture
Luuk Gruijs

Luuk Gruijs

@luukgruijs

L O A D I N G
. . . comments & more!

About Author

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite