Skip to main content

Field Has Not Been Indexed

Erroneous Code Example

This error occurs when you try to use a field in an operation that requires the field to be indexed, but the field has not been marked with INDEX in the schema.
QUERY findUserByEmail(email: String) =>
    users <- N<User>::WHERE(|u| u.email == email)
    RETURN users

Solution

Add the INDEX modifier to the field in your schema.
N::User {
    name: String,
    email: String INDEX,
}