I have this following SQL and I would like to know the MongoDB equivalent.
update tblName set kwatt = kwatt/3600000 where kwatt is not null.
Note:
I know we can write a JS function in the server and get this done, I want this to be done from PHP driver and I am not sure how can I do this easily.
Please help.
Actually you can do it with both combining
findAndModifyandstored javascripttogether..Create a stored function for division like ;
Then in findAndModify something like ;
It’s just for idea, I didnt test it..
Stored Javascript Sample