# Error when Saving a document to MongoDB database

**URL:** <https://forum.codewithmosh.com/t/error-when-saving-a-document-to-mongodb-database/18639>\
**Category:** Node\
**Created:** [March 9, 2023, 6:43am UTC](https://forum.codewithmosh.com/t/error-when-saving-a-document-to-mongodb-database/18639 "2023-03-09T06:43:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eden\_Nkhwazi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/eden_nkhwazi/32/4413_2.png) [@Eden\_Nkhwazi](https://forum.codewithmosh.com/u/Eden_Nkhwazi)\
**Post date:** [March 9, 2023, 6:43am UTC](https://forum.codewithmosh.com/t/error-when-saving-a-document-to-mongodb-database/18639/1 "2023-03-09T06:43:34Z")

</div>

![course.save() error](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/5/5a64f068478ddb532a207db339c81819e97c296e.png)

i have managed to connect to the database successfully but when i try to save the above document it throwing me this error .

please can somebody help! how do i get passed this error???

---

<div class="post-metadata">

**Author:** ![sufian.babri](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/sufian.babri/32/1028_2.png) [@sufian.babri](https://forum.codewithmosh.com/u/sufian.babri)\
**Post date:** [March 16, 2023, 2:54am UTC](https://forum.codewithmosh.com/t/error-when-saving-a-document-to-mongodb-database/18639/2 "2023-03-16T02:54:09Z")

</div>

It seems that your mongoose version is newer than what Mosh is using.

You can try installing the same version as Mosh to resolve the issue.
