将node.js和CouchDb的Hyperledger Fabric SDK用作状态数据库
stub.getQueryResult(queryString)
其中queryString是字符串化的
queryString.selector = {};
queryString.selector.docType = docType;
if (!userId) {
queryString.selector.userId = {'$gte': "0"};
} else {
queryString.selector.userId = userId;
}
if (sortBy && sortOrder) {
queryString.use_index = "_design/indexUserIdDoc";
queryString.sort=[{}];
queryString.sort[0][sortBy] = sortOrder;
}
queryString.skip = 1;
queryString.limit = 1;
一切正常,但跳过和限制被忽略; 此示例返回超过1行! 为什么呢?