In Server Code: How to iterate through each entry in a collection to test if a field matches a certain string
I am trying to iterate through a collection and test whether one of the fields for each entry in the collection matches a certain string. if so, i would like to delete this entry from database. what I am mainly having trouble with is the syntax used in server code order to call a delete function on an entry in a collection in a database.
the pseudocode for what i am attempting to describe:
for(each entry i in the database) {
if(i.field == "some string") {
database.delete(i);
}
}