Skip to content

Commit

Permalink
Merge pull request #3946 from sudo-rickroll/patch-5
Browse files Browse the repository at this point in the history
Update part3c.md
  • Loading branch information
mluukkai authored Jan 8, 2025
2 parents 87f42ec + 88348ee commit 46ebe62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/content/3/en/part3c.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ note.save().then(result => {
})
```

When the object is saved to the database, the event handler provided to _then_ gets called. The event handler closes the database connection with the command <code>mongoose.connection.close()</code>. If the connection is not closed, the program will never finish its execution.
When the object is saved to the database, the event handler provided to _then_ gets called. The event handler closes the database connection with the command <code>mongoose.connection.close()</code>. If the connection is not closed, the connection remains open until the program terminates.

The result of the save operation is in the _result_ parameter of the event handler. The result is not that interesting when we're storing one object in the database. You can print the object to the console if you want to take a closer look at it while implementing your application or during debugging.

Expand Down

0 comments on commit 46ebe62

Please sign in to comment.