amend to mongodb script