我使用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: [] } }
有什么想法吗?