On empty DB, I'm trying to ensure that I insert exactly one record like this:
{ short_code: 1 }... and that concurrent processes doing the same thing will instead increment the short_code.
> db.runCommand({findAndModify: 'short_code', upsert: true, update: { $inc:
{ short_code: 1 }}, query:
{ short_code: true }, new: true })
{
"errmsg" : "exception: assertion db/../util/../util/../db/../bson/bsonobjbuilder.h:115",
"code" : 0,
"ok" : 0
}