In Mongodb Aggregation Framework, you have arithmetic operators like $multiply or $add and so on, I know you can do something similar to { $multiply : [ myField, 0 ] } easily in MongoDb, but how can you do it in Java? I tried new BasicDBObject("$multiply", new BasicDBObject(myField, 0))" in Java, but I got
"errmsg" : "exception: the $multiply operator does not accept an object as an operand".
So I wonder if you can do the same thing in Java?
Thanks!!