Skip to content

Views can't be used as bindVars when constructing an AqlQuery #667

@uatuko

Description

@uatuko
const view = db.arangoSearchView("some-view");
const result = await db.query(aql`
  FOR d IN ${view}
  SEARCH PHRASE(d.key, "some value", "text_en")
  RETURN d
`);

The above throws ArangoError: AQL: SEARCH condition used on non-view near 'RETURN d' at position 4:3 (while parsing).

I can make this work by using const view = db.collection("some-view");, but that's a hack.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixedIssue has been resolved but remains open due to a pending release.semver-minorThis issue does not require any backwards-incompatible changes to address.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions