Fix MongoDB bulk upserts