Comment 2 for bug 1699678

Revision history for this message
John A Meinel (jameinel) wrote :

So this did land, but it turns out that Mongo 2.4 "supports" $bit. Specifically, in 2.4 it fails to create a document if you specify upsert:

3.2:
> db.foo.update({_id: "a"}, {$bit: {"a": {"or": NumberLong(1)}}}, {upsert: 1})
WriteResult({ "nMatched" : 0, "nUpserted" : 1, "nModified" : 0, "_id" : "a" })
> db.foo.find()
{ "_id" : "a", "a" : NumberLong(1) }
>

2.4:
> db.foo.update({_id: "a"}, {$bit: {"a": {"or": NumberLong(1)}}}, {upsert: 1})
WriteResult({ "nMatched" : 0, "nUpserted" : 0 })
> db.foo.find()

And since we still use 2.4 on Trusty, we either need to special case this, or not use $bit.