Tested on Aqua Data Studio 14.0-alpha-23 Build #: 32551 on Ubuntu 12.04( Mongo DB 2.4.3)
Next statements give exceptions:
1. With arithmetic operations on only constants error message: NoViableAltException on
insert into baseball(valuation) values(1*4/2+2-1%2)
But next eqv Mongo shell statement works correct
db.baseball.insert({valuation:1*4/2+2-1%2})
In Update statement next error message: Composed math expressions not supported inside the SET clause:
update baseball set valuation = 1*4/2+2-1%2
But in Mongo shell eqv. statement works correct
db.baseball.update({},{$set:{valuation:1*4/2+2-1%2}},false,true)
2. On logical/bitwise operations on constants:
Error message: Unknown tree node
insert into valuation(valuation) values ( !(3&1|0))
But eqv statement in Mongo shell correct
db.baseball.insert({valuation:!(3&1|0)})
Error mesage:NoViableAltException
insert into valuation(valuation) values ( 3&1|0)
But eqv statement works correct in Mongo shell
db.baseball.insert({valuation:3&1|0})
Same for UPDATE:
Error message: Unknown tree node
update baseball set valuation= !(3&1|0)
But in Mongo shell works correct:
db.baseball.update({},{$set:{valuation:!(3&1|0)}},false,true)
Error message: Bitwise update operations should be performed on the same field
update baseball set valuation= (3&1|0)
But in Mongo shell works correct:
db.baseball.update({},{$set:{valuation:(3&1|0)}},false,true)
For the MongoShell equivalents, the arithmetic operations (i.e. the value of the "valuation" field used on the update() / insert() commands) is evaluated by Javascript, thus MongoShell receives the final value (the result of math expr evaluation).
Cannot implement this under MongoSQL.