mongoose-datatables icon indicating copy to clipboard operation
mongoose-datatables copied to clipboard

DeprecationWarning with Possible Fix Suggestion

Open VonSwirl opened this issue 6 years ago • 1 comments

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

VonSwirl avatar Jul 18 '18 09:07 VonSwirl

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

jpldevpub avatar Jun 26 '19 09:06 jpldevpub