DEV Community

Discussion on: Build an API using Node, Express, MongoDB, and Docker

racribeiro profile image
Rui Ribeiro

Why mongoose and not just mongodb library? (document models?)

An API should always provide OpenAPI schema, how can you add it to this project? If you have models, it should be straight forward...

koladev profile image
Mangabo Kolawole Author

Yes. I went with mongoose because of the abstraction it provides to define schema and make queries.

About the OpenAPI schema, I think that there are swagger packages for Nodejs you can use to document your API. I haven't try it yet.

Let me know if you have some suggestions