Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schemas with timestamp enabled are not working #14

Open
mergingseas opened this issue Feb 27, 2022 · 3 comments
Open

schemas with timestamp enabled are not working #14

mergingseas opened this issue Feb 27, 2022 · 3 comments

Comments

@mergingseas
Copy link

after creating a schema and then setting "timestamp: true" I get error when creating the document.

Screen Shot 2022-02-27 at 3 24 23 PM
Screen Shot 2022-02-27 at 3 25 42 PM

@FelixFurtmayr
Copy link
Collaborator

Seems to me this is a problem with mongoose itself. Other people are experiencing also problems with additional options:
https://stackoverflow.com/questions/63436981/mongoose-adding-subdocument-to-array-giving-error-id-this-ownerdocument-m

Would you try to install a newer mongoose version? If this fixes the problem, I can update it.
However - I have become careful with updating mongoose as this can lead to problems - open new bugs that you did not know about ;-)

@mergingseas
Copy link
Author

mergingseas commented Feb 28, 2022

using timeslots:true doesn't seem to be an issue when using mongoose directy. I did upgrade to mongoose 6 which is the latest driver for the latest mongodb update to mongodb 5

thanks

@mergingseas
Copy link
Author

mergingseas commented Feb 28, 2022

this is my current workaround using mongoose-multi
timestamps: { currentTime: () => new Date() }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants