Ran this via terminal on an existing mongodb database hosted in aws ec2 instance:
db.users.update({},{ $inc: { point_total: 100 } }, {multi:true})
In additional to increasing variable by 100 for all users there were also entry changes to another variable (history) in the same collection.
history: [{
c_id: String,
created_at: {type: Date, default: Date.now },
reason: String, //Received, Sent
amount: String
}]
Unwanted changes include the reason variable within history was changed from "Received" to "Sent" for various users.
As my query wasn't addressing "history", are there ideas as to what caused this?