Skip to content
Advertisement

Tag: mongodb

What’s the point of using save() in Mongoose?

I’m learning MongoDB and Mongoose, and I’ve watched instructors advise to use the save() function to save the changes made to the database. But I’m still making changes successfully without using save(). I’ve made two functions to add a document to the database, one with using save() and the second one without using save(), and they all did the same

Using new collections for each user

I am building an Expense Tracking app using Node.js where all the Income and Costs should get saved in a database. My idea is to create a new collection for each registered user and save all their income/cost actions in that collection. The things i would like to consider before writing it are: how do i name the collections Efficiency

Advertisement