Couchbase节点SDK错误:JSON解组错误:没有名称为DistinctScan

时间:2017-03-13 16:32:06

标签: node.js couchbase couchbase-nodejs-sdk

我使用Couchbase服务器(4.5企业版)节点SDK(v2.3.0)来执行一些N1ql。

当我打开couchbase web工作台来执行以下N1ql时,一切正常。

SELECT meta().id, * FROM `Sample-Bucket` where owner != 'userid' AND recycled IS MISSING AND ANY g IN groups SATISFIES g = 'groupid' END

当我使用node sdk时,

const QUERY  = 'SELECT meta().id, * FROM `Sample-Bucket` where owner != $userid AND recycled IS MISSING AND ANY g IN groups SATISFIES g = $groupid END'

let query = n1ql.fromString(QUERY).adhoc(false);

    params = {
        userid: 'userid',
        groupid: 'groupid'
    };

cluster.executeN1ql(query, params, (err, results) => {

    console.log(err);
})

我收到以下错误:

{ [ErrInternalError: Unexpected Database Error]
status: 500,
message: 'Unexpected Database Error',
name: 'ErrInternalError',
_trace: true,
_cause: 
 { [Error: Unable to decode prepared statement - cause: Unrecognizable    prepared statement - cause: JSON unmarshalling error: No operator for name DistinctScan]
 requestID: '2d3d28f9-7298-4d4f-93f8-cd35aab04077',
 code: 4070,
 otherErrors: [] } }

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

我认为这是编译计划中某些运算符在已准备好的语句中的已知问题。我也answered this on the Couchbase Forums