MongoDB Java driver : no such cmd: aggregate
问题 I am calling the MongoDB aggregate function in my code as : AggregationOutput output = collection.aggregate( matchUserID, unwindF, matchFUsers,projection); I have tested my code in my localhost, and it works perfect. When I am using the same in another DB (version 2.2.1), it gives this error : com.mongodb.CommandResult$CommandFailure: command failed [aggregate]: { "serverUsed" : "<server address>" , "errmsg" : "no such cmd: aggregate" , "bad cmd" : { "aggregate" : .... } Any clue why ? 回答1: