#4761·surrealdb

Bug: Can't use record::id(id) inside WHERE

Author: lveillardCreated Sep 13, 2024Updated Sep 16, 2026
Labelsnoissuetopic:database_functions

Describe the bug

Using filters on optional props might throw errors.

Steps to reproduce

CREATE A:1 SET b=(CREATE ONLY B:1); CREATE A:2 SET b=(CREATE ONLY B:2); CREATE A:3;
SELECT * FROM A WHERE record::id(b.id)==1;
->Incorrect arguments for function record::id(). Argument 1 was the wrong type. Expected a record but found NONE```

Expected behaviour

Ideally, this should work

SELECT * FROM AWHERE b.id() = 1

Alternatives

SELECT * FROM A WHERE b.id && record::id(b.id)==1;

SurrealDB version

2.0.0.beta3

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct