I have a class in parse called testItem, this is a snapshot of this class

As you can see, the same element appears many times, but this is normal because it is in different schools and canteens, but this item appears twice in the same dining room and school, so this is a duplicate in diningHallNumber: 1 and Union College twice, so this is a duplicate. Therefore, I am trying to write a code function to remove it. Here is what I still have:
Parse.Cloud.job("removeDuplicateItems", function(request, response) { function checkDuplicate(school) { var TestItem = Parse.Object.extend("TestItem"); var testItemsQuery = new Parse.Query(TestItem); testItemsQuery.equalTo('school', schoolArray[i]); testItemsQuery.each(function(testItem) { var item = testItem.get('item'); var school = testItem.get('school'); var diningHallNum = testItem.get('diningHallNumber'); var testItemsQueryCheck = new Parse.Query(TestItem); testItemsQueryCheck.equalTo ('item', item); testItemsQueryCheck.equalTo ('school', school); testItemsQueryCheck.equalTo ('diningHallNumber', diningHallNum);
but it will not work, because it will always come true. I need a way to see if this is the second time this item has appeared. How can i do this?
Thanks for the help in advance.
user3692917
source share