diff --git a/lib/mongoose-datatables.js b/lib/mongoose-datatables.js index 59a7d4f..dc8ff58 100644 --- a/lib/mongoose-datatables.js +++ b/lib/mongoose-datatables.js @@ -79,7 +79,7 @@ function dataTablesPlugin (schema, options) { } Promise - .all([query.exec(), thisSchema.count(find)]) + .all([query.exec(), thisSchema.countDocuments(find)]) .then(function (results) { var response = {} response[totalKey] = results[1]