mongodb - Use $push and $max in aggregate -
Why can not I use the maximum $ push and $ max in the same operation?
... total ... {$ group: {_id: "$ id", op: {$ push: {"max": {$ max: "$ value"}} }} ... .
"errmsg": "Exception: Invalid operator '$ max'",
Because $ max is a group operator , it must adhere to the syntax: Field: Group operator group operator in code> expression , such as $ push, $ max, $ min, ... < / P>
Comments
Post a Comment