code: func (scg scanCommandGroup) xscanCommand(c *client) error {
  	args := c.args
  
  	if len(args) < 2 {
  		return ErrCmdParams
  	}
  
  	var dataType ledis.DataType
  	switch strings.ToUpper(hack.String(args[0])) {
  	case "KV":
  		dataType = ledis.KV
  	case "HASH":
  		dataType = ledis.HASH
  	case "LIST":
  		dataType = ledis.LIST
  	case "SET":
  		dataType = ledis.SET
  	case "ZSET":
  		dataType = ledis.ZSET
  	default:
  		return fmt.Errorf("invalid key type %s", args[0])
  	}
  
  	cursor, match, count, desc, err := scg.parseArgs(args[1:])
  
  	if err != nil {
  		return err
  	}
  
  	var ay [][]byte
  
  	if !desc {
  		ay, err = c.db.Scan(dataType, cursor, count, false, match)
  	} else {
  		ay, err = c.db.RevScan(dataType, cursor, count, false, match)
  	}
  
  	if err != nil {
  		return err
  	}
  
  	data := make([]interface{}, 2)
  	if len(ay) < count {
  		data[0] = scg.lastCursor
  	} else {
  		data[0] = ay[len(ay)-1]
  	}
  	data[1] = ay
  	c.resp.writeArray(data)
  	return nil
  }
docs: // XSCAN type cursor [MATCH match] [COUNT count] [ASC|DESC]