function DataModelUtils.getChildrenWithCriteria(a,s)local z={}for a,i in ipairs(a:GetChildren())do local O=true for a,s in pairs(s)do local z,j=pcall(function()return i[a]==s end)if not(z and j)then O=false break end end if O then table.insert(z,i)end end return z end return DataModelUtils

function DataModelUtils.getChildrenWithCriteria(parent, criteria)
	local results = {}
	for _, child in ipairs(parent:GetChildren()) do
		local isMatch = true
		for property, value in pairs(criteria) do
			local success, result =
				pcall(
				function()
					return child[property] == value
				end
			)
			if not (success and result) then
				isMatch = false
				break
			end
		end
		if isMatch then
			table.insert(results, child)
		end
	end
	return results
end

return DataModelUtils
