Simple nested paths N1QL not working


We have a third-partylibrary that’s using a nested paths query, which is not working due to a"syntax-error". So I tried to create a document and execute the query myself, but still get the same error.

I’m running CouchBase 4.5.1 and I’m trying to execute the following nested paths query:
SELECT * FROM default.primary_contact

But the response I get is a syntax error:
“code”: 3000,
“msg”: “syntax error - at .”,
“query_from_user”: “SELECT * FROM default.primary_contact”

If I instead execute this query, I get the excpected response:
SELECT primary_contact FROM default
“primary_contact”: [
“name”: “John Smith”,
“phone”: “+1-650-555-1234”
“name”: “Jane Brown”,
“phone”: “+1-650-555-5678”


It works fine on Couchbase Server 4.5.0-2601 Enterprise Edition (build-2601)

Yes, this syntax has been deprecated. Try

SELECT primary_contact
FROM default;

Just to add to what @geraldss said, this is mentioned in the Release Notes for 4.5.1.


But please consider adding this to the Couchbase 4.5 documentation, it says nothing about it being deprecated in 4.5.1. which is something you don’t expect in a path release.

Hi @prasad, @amarantha.

hi @jonny.dahlberg,
we deprecated it in 4.5 and changed the behavior in 4.5.1. Both are documented in respective release notes

However, I see the FROM-clause documentation still uses nested paths in some examples. We will fix that.