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

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -