I have a document like this:
{
price = 140.23563
}
How can multiply the price by 100?
I have a document like this:
{
price = 140.23563
}
How can multiply the price by 100?
As of the release notes from upcoming Mongo 2.6 you would be able to use the new $mul operator. It would multiply the value of the field by the number with the following syntax.
{
field: { $mul: <number> }
}
P.S. keep in mind that 2.6 is not released right now, but will be really soon. You can use experimental 2.5.x instead right now.