Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code example using variables throws parse error #8

Closed
W4G1 opened this issue Sep 15, 2022 · 1 comment
Closed

Code example using variables throws parse error #8

W4G1 opened this issue Sep 15, 2022 · 1 comment

Comments

@W4G1
Copy link

W4G1 commented Sep 15, 2022

This snippet is documented here: https://surrealdb.com/docs/surrealql/parameters

let people = await db.query("SELECT * FROM article WHERE status IN $status", {
  status: ["live", "draft"],
});

It does not seem to work however:
Error: There was a problem with the database: Parse error on line 1 at character 35 when parsing 'IN $status'

Environment:

> deno --version
deno 1.23.2 (release, x86_64-pc-windows-msvc)
v8 10.4.132.8
typescript 4.7.2
> surreal version
surreal 1.0.0-beta.7 for windows on x86_64
@W4G1 W4G1 changed the title Code example in docs using variables throws parse error Code example using variables in docs throws parse error Sep 15, 2022
@W4G1 W4G1 changed the title Code example using variables in docs throws parse error Code example using variables throws parse error Sep 15, 2022
@tobiemh
Copy link
Member

tobiemh commented Sep 16, 2022

Hi @W4G1, this is an error in the website example, and I'll get this changed on the site. You can use the INSIDE operator...

let people = await db.query("SELECT * FROM article WHERE status INSIDE $status", {
  status: ["live", "draft"],
});

@tobiemh tobiemh closed this as completed Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants