Compound comparison implemented through redis and lua