Examples of HelixDB queries
QUERY FindActiveUsers() => users <- N<Person>::WHERE(_::{Age}::GT(25)) withFollowers <- users::WHERE(EXISTS(_::In<Follows>)) RETURN withFollowers
QUERY CreateFriendship(user1Id, user2Id) => user1 <- N<Person>(user1Id) user2 <- N<Person>(user2Id) friendship <- AddE<Follows>({Since: "2024"})::From(user1)::To(user2) RETURN friendship
QUERY GetFriendsWithAge(userId) => user <- N<Person>(userId) friends <- user::Out<Follows>::InN::{Name, Age} RETURN friends
QUERY AnalyzeNetwork(userId) => user <- N<Person>(userId) activeConnections <- user::Out<Follows> ::WHERE(_::{Weight}::GT(0.5)) ::InN ::WHERE(_::Out::COUNT::GT(5)) result <- activeConnections::{ Name: _::{Name}, ConnectionCount: _::Out::COUNT } RETURN result
Was this page helpful?