简单N1QL查询的查询错误,错误代码4010,

时间:2019-11-07 09:36:42

标签: couchbase n1ql

我正在尝试这些查询,但是所有这些都在沙发上出现错误

SELECT * FROM `hostels` where ANY reqId IN data.identifier SATISFIES reqId.id  = "91" END;
"Keyspace not found keyspace hostels - cause: No bucket named hostels",

SELECT * FROM 'hostels' where ANY reqId IN data.identifier SATISFIES reqId.id  = "91" END;
"FROM expression term must have a name or alias"

SELECT * FROM "hostels" where ANY reqId IN data.identifier SATISFIES reqId.id  = "91" END;
"FROM expression term must have a name or alias",

1 个答案:

答案 0 :(得分:1)

仅当您的存储桶名称中带有-时,才需要使用反引号(例如travel-sample)。这个应该也可以工作:

SELECT * FROM hostels where ANY reqId IN data.identifier SATISFIES reqId.id  = "91" END;

上面的查询没有任何问题,您可能拼错了存储桶的名称。