0

我正在使用 Couchbase 服务器(4.5 Enterprise)节点 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: [] } }

有任何想法吗?

4

1 回答 1

1

我认为这是准备好的语句中编码计划中某些运算符的已知问题。我也在Couchbase 论坛上回答了这个问题

于 2017-03-14T01:18:03.447 回答