There is an `upsert` command for mongodb, might make more sense than the two stage operation.  Not sure though.