Hello !
I have a problem with minimongo. I want to update an integer field of my database. I want to use the $mul operator because I must multiplied the value by a multiplicator.
To do that I have read the documentation of mongodb and I found a solution :
PlayerEmployees.update({_id: currentUser.playerEmployeesId, 'employees.idEmployee': employeeId}, {$mul: {'employees.$.currentIncomeRate': parseFloat(multiplier)}});
And when I run my application, an error appear :
Exception while simulating the effect of invoking 'buyBonus' errorClass {error: 409, reason: "MinimongoError: Invalid modifier specified $mul", details: undefined, message: "MinimongoError: Invalid modifier specified $mul [409]", errorType: "Meteor.Error"} Error: MinimongoError: Invalid modifier specified $mul [409]
at m.(anonymous function) (http://localhost:3000/packages/allow-deny.js?hash=28b7b02fffd8490f81f75fa9580e532e61473c0a:215:21)
at http://localhost:3000/packages/ddp-client.js?hash=b5f1b97df6634673c68f37914ae9f4c3231c438e:3957:25
at _.extend.withValue (http://localhost:3000/packages/meteor.js?hash=ae8b8affa9680bf9720bd8f7fa112f13a62f71c3:1077:17)
at _.extend.apply (http://localhost:3000/packages/ddp-client.js?hash=b5f1b97df6634673c68f37914ae9f4c3231c438e:3948:54)
at _callMutatorMethod (http://localhost:3000/packages/allow-deny.js?hash=28b7b02fffd8490f81f75fa9580e532e61473c0a:433:29)
at update (http://localhost:3000/packages/mongo.js?hash=bc4cc4faf274ce28cefc812067aa65c0d4025ed4:673:19)
at increaseRateOfEmployee (http://localhost:3000/app/app.js?hash=b915234a84cd634f77916aee1b4315f732092ee9:958:18)
at buyBonus (http://localhost:3000/app/app.js?hash=b915234a84cd634f77916aee1b4315f732092ee9:931:21)
at http://localhost:3000/packages/ddp-client.js?hash=b5f1b97df6634673c68f37914ae9f4c3231c438e:3957:25
at _.extend.withValue (http://localhost:3000/packages/meteor.js?hash=ae8b8affa9680bf9720bd8f7fa112f13a62f71c3:1077:17)
I don’t understand. Is the $mul operator exist in minimongo ? If not how can I fix my problem ?
Sorry for my bad english, I’m french
Thank you !!