mongoose-datatables
mongoose-datatables copied to clipboard
DeprecationWarning with Possible Fix Suggestion
DeprecationWarning:
collection.count is deprecated, and will be removed in a future version. Use collection.countDocuments or collection.estimatedDocumentCount
Suggested fix/solution
In mongoose-datatables.js line 82
Change:
.all([query.exec(), thisSchema.count(find)])
To:
.all([query.exec(), thisSchema.countDocuments(find)])
#16
Now using mongoose-datatables.js file locally without package and works with this fix. no longer getting
DeprecationWarning: collection.count is deprecated, and will be removed in a future version. Use collection.countDocuments or collection.estimatedDocumentCount instead
message