I'm trying to update a field seconds_until_start
by a calculation of two other fields. This doesn't seem to work in mongodb in the way that seems most intuitive. Any suggestions what else I can do are appreciated.
db.price_scrape.update({"timestamp": {"$exists": true}},
{"$set": {
seconds_until_start: {$divide: [{$subtract: ["$marketstarttime", "$timestamp"]}, 1000]}
}},
multi=true)
The dollar ($) prefixed field '$divide' in 'seconds_until_start.$divide' is not valid for storage.