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

Popular posts from this blog

Out of index C/C++ -

regex - PatternSyntaxException: while using String.ReplaceAll function in java? -

java - Projects which are accessed via multiple (different) IDEs: Ant or Maven? -