Fix mongodb upsert