Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
创建索引时出现此错误:
[ { "code": 3000, "msg": "syntax error - at -", "query_from_user": "create primary index on sample-partner" } ]
如果我将存储桶名称更改为 sample_partner,那么它可以工作。使用 Couchbase 4.5 企业版。
是的,那是因为 N1QL 会将 解释-为减号......您只需使用反引号转义存储桶名称:
-
CREATE PRIMARY INDEX ON `sample-partner`;
它应该这样工作。请记住在所有 N1QL 查询中始终转义该存储桶名称,您应该没问题。或者使用存储桶名称中的下划线作为替代方案:)