2

I have a collection called one-two and I would like to list a few of the documents in the collection:

FOR v IN one-two
    RETURN v

But I get the following error: Query: AQL: collection or view not found: one (while parsing)

How do I specify the collection with a - in the name?

I've tried the usual options, ', " and camelCasing it oneTwo but they all fail. The ArangoDB documentation Collection and View Names clearly states that a dash (-) is permitted.

Screenshot showing the error

Screenshot showing the collection

Insectatorious
  • 1,305
  • 3
  • 14
  • 29

1 Answers1

3

For normal REST requests operating on such a collection no escaping is needed.

However, in AQL a dash (-) can also be interpreted as a minus operator. That's why in a query, a name with a dash has to be put into backticks: `one-two`

But since this is only relevant for AQL, this information can be found in the AQL Syntax documentation, not in the documentation about collection names that you referenced.

mpoeter
  • 2,574
  • 1
  • 5
  • 12