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

npm run clean - "model.deleteMany is not a function" #238

Open
rohanshukla94 opened this issue Dec 16, 2021 · 3 comments
Open

npm run clean - "model.deleteMany is not a function" #238

rohanshukla94 opened this issue Dec 16, 2021 · 3 comments

Comments

@rohanshukla94
Copy link

The Issue
A clear and concise description of what the bug is.
When I run the npm run clean command I get the error saying 'model.deleteMany is not a function'

@davellanedam
Copy link
Owner

Your MongoDB must be too old. Try upgrading.

@rohanshukla94
Copy link
Author

ζ mongo --version [bbe462d]
MongoDB shell version v5.0.3
Build Info: {
"version": "5.0.3",
"gitVersion": "657fea5a61a74d7a79df7aff8e4bcf0bc742b748",
"openSSLVersion": "OpenSSL 1.1.1 11 Sep 2018",
"modules": [],
"allocator": "tcmalloc",
"environment": {
"distmod": "ubuntu1804",
"distarch": "x86_64",
"target_arch": "x86_64"
}
}

I think it maybe because you are not checking if all the models exists in the db before deleting them?

@davellanedam
Copy link
Owner

Are you trying to clean without first seed? Yeah that can also happen

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