db.getCollection('someCollection').update({"SomeNumberField": 1},
{ $set:
{
SomeNumberField: NumberLong(1)
}
}, { multi: true })
This saves "SomeNumberField" as a double. I checked the docs, and they recommend "NumberInt", which, I assume, should be an int32, but that doesn't work either.
I am surprised I can't find info on this.
Edit: I have tried:
SomeNumberField: NumberLong("1")
As in the answer here, still doesn't work.