support minkey/maxkey