noob
noob

Reputation: 490

Couchbase N1QL: issue on querying array field

Hi I have a test doc like this:

{
  "doctype": "test",
  "users": [
    1,
    2
  ]
}

Then I used below query to get the result:

SELECT * FROM bucket WHERE doctype = "test" AND ANY user IN users SATISFIES user = 1 END;

But I got this error: "msg": "syntax error - at user". Who knows where I got wrong? Thanks

Upvotes: 1

Views: 130

Answers (1)

geraldss
geraldss

Reputation: 2445

USER is a reserved word.

You can use u instead, or place USER in back ticks to escape it.

Upvotes: 2

Related Questions