10

I've been testing Couchbase 5 and created a bucket called fp-conversion-data which has some JSON data in it. I have been trying to run some simple queries such as:

SELECT * FROM fp-conversion-data limit 5;

Instead of getting the expected results, I keep getting this error:

[
  {
    "code": 4010,
    "msg": "FROM expression term must have a name or alias",
    "query_from_user": "SELECT * FROM fp-conversion-data limit 5;"
  }
]
Matthew Groves
  • 25,181
  • 9
  • 71
  • 121
DavidR
  • 6,622
  • 13
  • 56
  • 70

1 Answers1

20

I think the problem is that you have dashes in the name of the bucket. Use backticks (`) around the bucket name.

Try this:

SELECT *
FROM `fp-conversion-data`
LIMIT 5;
Matthew Groves
  • 25,181
  • 9
  • 71
  • 121
  • 2
    Sh*%! That did it! Might be good to update that you need to use ` and not ' which is what I had tried previously. – DavidR Jan 29 '18 at 22:02