fabric使用couchdb时skip\limit语句失效的原因

    // 1、Add limit
	// This will override any limit passed in the query.
	// Explicit paging not yet supported.
	jsonQueryMap[jsonQueryLimit] = queryLimit
	// Add skip of 0.
	// This will override any skip passed in the query.
	// Explicit paging not yet supported.
	jsonQueryMap[jsonQuerySkip] = querySkip


 



    // 2、Get the querylimit from core.yaml
	queryLimit := ledgerconfig.GetQueryLimit()
	// Explicit paging not yet supported.
	// Use queryLimit from config and 0 skip.
	queryString, err := applyAdditionalQueryOptions(query, queryLimit, 0)



//3、GetQueryLimit exposes the queryLimit variable
func GetQueryLimit() int {
	queryLimit := viper.GetInt(confQueryLimit)
	// if queryLimit was unset, default to 10000
	if !viper.IsSet(confQueryLimit) {
		queryLimit = 10000
	}
	return queryLimit
}

代码路径hyperledger\fabric\core\ledger\kvledger\txmgmt\statedb\statecouchdb\statecouchdb.go。

似乎原作者用一种粗暴的方式默认置入了limit和skip,若未配置limit则为0~10000,并不能自定义实现分页。

你可能感兴趣的:(fabric)