Home / Companies / Neo4j / Blog / Post Details
Content Deep Dive

Neo4j.rb: Query or QueryProxy?

Blog post from Neo4j

Post Details
Company
Date Published
Author
Neo4j
Word Count
1,319
Company Posts That Month
11
Language
English
Hacker News Points
-
Summary

The Neo4j.rb gem provides two main classes for building Cypher queries: Neo4j::Core::Query and Neo4j::ActiveNode::Query::QueryProxy. QueryProxy is a convenience class that uses information from models to build queries, whereas Core::Query is more flexible but requires explicit syntax. The key to getting the most out of Neo4j.rb is understanding how to move between these two classes in different situations. Methods like `query` and `query_as` can be used to convert QueryProxy objects to Core::Query objects, while methods like `proxy_as` can be used to convert Core::Query objects back to QueryProxy objects. By leveraging these tools, developers can optimize their Cypher queries for performance and create more efficient code.

Trends Found in this Post

No tracked trend matches for this post yet.