node-express-mongodb-jwt-rest-api-skeleton
node-express-mongodb-jwt-rest-api-skeleton copied to clipboard
npm run clean - "model.deleteMany is not a function"
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'
Your MongoDB must be too old. Try upgrading.
ζ 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?
Are you trying to clean without first seed? Yeah that can also happen