couchbasesql++

Couchbase query where flag must not be true


I have documents in Couchbase that contain data like this:

{
  "name": "doc1",
  "is_deleted": true
}    

{
  "name": "doc2",
  "is_deleted": false
}

{
  "name": "doc3",
}

I want to run a query that will only ignore doc1 but return the other two. Using where is_deleted != "true" did not help. How would this query be correctly phrased?


Solution

  • In your predicate != "true", you're comparing a boolean to a string. Try != true instead.

    Also you may need to use IS (NOT) MISSING syntax to handle the doc3 case.