Ask Your Question
2

What is the reason for Mongoose to instantly update the database when a property is modified instead of waiting for save()?

asked 2022-05-03 11:00:00 +0000

scrum gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-12-21 00:00:00 +0000

devzero gravatar image

Mongoose is designed to allow real-time data manipulation in the database, which is why it instantly updates the database when a property is modified. This feature is especially important in applications that require real-time updates or to support multi-user collaboration. When Mongoose detects a change in a model property, it immediately sends the update query to the database, keeping everything in sync in real-time. This eliminates the need for developers to manually call the save() method to make changes persistent in the database.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-05-03 11:00:00 +0000

Seen: 10 times

Last updated: Dec 21 '21