Skip to content

Commit

Permalink
add a deprecation warning log on collection.group
Browse files Browse the repository at this point in the history
  • Loading branch information
mpangrazzi committed May 6, 2019
1 parent 1f3646b commit ff4f914
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ Collection.prototype.group = function (keys, condition, initial, reduce, finaliz
fn = opts
opts = {}
}

console.warn('DEPRECATED (collection.group): MongoDB 3.6 or higher no longer supports the group command. We recommend rewriting using the aggregation framework.')

return this._dispatch(function group (args) {
return args.col.group(args.keys, args.condition, args.initial, args.reduce, args.finalize, args.command, args.options)
})({options: opts, keys: keys, condition: condition, initial: initial, reduce: reduce, finalize: finalize, command: command, callback: fn}, 'group')
Expand Down

0 comments on commit ff4f914

Please sign in to comment.