Deleting documents from collection if they are found in text file?

Hi there, I’m pretty new to mongo but am trying to figure out how I would delete certain documents from my db if they match the contents of an array. For example, let’s say I wanted to delete some sports teams from my db. I want to be able to take a list of sports teams for deletion in a text file, and then delete those teams from my db without doing it manually.

In my mind, it would look something like:

db.sportsTeams.deleteMany( { "teamName" : { $in [$arrayOfNamesToBeDeleted] } } )

If I’m on the right track, how would I actually create arrayOfNamesToBeDeleted from a text file?

Thank you for your help.

This is outside the scope of this forum. It depends of the programming language you are using. I would try stackoverflow and any language specific forum.