I don't think so, given that BSONObj type (the one to which insertedDoc belongs) is not mutable. There is another type, BSONObjBuilder, than can be used for this... but I think that type doesn't allow a compact usage of the BSON() macro (it reliese in append() functions, to add each field).

I would have a look to this...