Query overview
Connection banner
If you are not connected to an instance, the dropdown on the connection banner lets you either select from recent instances or to specify a new instance. Once you have entered your credentials, if needed, the status shows Connected and you are ready to start querying. This dropdown is also where you can switch database, instance, or disconnect.
Sidebar
The sidebar contains a set of drawers; database information, saved Cypher, and Query history.
Database information
This drawer contains information about the database you are connected to. It gives you an overview of the node labels and relationship types, as well as what property keys exist in the database. If you select one, you see a sample of the selected element as a graph or table.
Additionally, the drawer contains node and relationship counts, displayed in parantheses.
Saved Cypher
The Saved Cypher drawer is where you keep your bookmarked queries and commands.
From here, you can organize your saved Cypher, download or upload these, or delete them if needed. To run a saved query, click on it to populate it to the Cypher editor and use the play button to execute.
To save a query, use the bookmark icon in the Cypher editor.
Query history
This drawer contains a list of your previously run queries, for your reference. Queries are kept here until you delete them and are not limited to the current instance.
Cypher Reference
The Cypher reference is an embedded version of the Cypher Cheat Sheet. It allows you to search for Cypher-related terms such as queries, patterns, and clauses, directly in Query. It is divided into sections and subsections for easy navigation and each subsection can be expanded and collapsed.
You can select an example to run it in the editor or copy it to the clipboard. Note that some examples require data you may not have in your database and may not be runnable nor yield desired results, but are used to illustrate syntax and functionality of Cypher.
Every subsection is also a link to the Cypher Manual for more details.
Cypher editor
The Cypher editor is the primary interface for entering and running Cypher queries and commands. The editor can be instantiated several times, which allows you to edit the query inside the result frame and rerun it. It can hold multiple lines for long queries or commands.
Syntax highlighting
-
A smart highlight of matching pairs around the current position of the cursor, for example, matching brackets, braces, and parenthesis.
-
Matching pairs are auto-closed.
-
A smart highlight of identical words on a word click.
-
Words, such as attributes, anon name, and values, are highlighted in different colors.
-
Any punctuation, such as parenthesis and comma, has a slightly different color than text.
-
Warnings are displayed with a red squiggly line that displays the error if you hover.
Description | Keyboard shortcut (Mac OS) | Keyboard shortcut (Windows and Linux) |
---|---|---|
Select highlighted identical words one by one. |
command + D |
Ctrl + D |
Select all highlighted identical words. |
command + shift + L |
Ctrl + shift + L |
Move a query line up and down. |
ALT + arrow |
ALT + arrow |
Delete a query line. |
command + shift + K |
Ctrl + shift + K |
Add multiple cursors, if you want to add several lines at the same time. |
command + ALT + arrow |
Ctrl + ALT + arrow |
Search and replace. |
command + F |
Ctrl + F |
Run a query. |
command + enter |
Ctrl + Enter |
Reusable result frames
The reusable result frames in Query allow you to edit the query of an existing result directly in the result fram and rerun it to update the result in situ. You can also use Cmd/Ctrl + click to send it back to the main editor and re-run it from there.
Query supports different result frame views:
-
Graph — Display the result as nodes and relationships and allow styling to be configured.
-
Table — Display the result as JSON formatted rows.
-
RAW — Display the submitted request, the Neo4j Server version and address, and the response.
Stream
A stream is a scrolling series of result frames.
A reusable result frame is created for each command execution, added to the top of the stream to create a scrollable collection in reverse chronological order.
You can expand and collapse the result frames using the Collapse icon.
To remove all the frames from the stream, use the :clear
command.
Clearing the stream does not clear the history, that is done from the Query history drawer, as mentioned previously.
Query co-pilot
The co-pilot is a feature that helps you write Cypher queries. It allows you to use natural language to ask the database a question, to query the database in other words. You enter your question and the co-pilot suggests a Cypher query based on your input. You can edit the query and run it or rephrase your question to generate a new query.
When you write a question, it is automatically augmented with the current database schema, which provides the LLM with the right context. Being familiar with the database schema helps you write questions that are more likely to generate accurate Cypher queries.
If you need a reminder what your datamodel looks like, you can use the procedure |
The co-pilot is available from the Cypher editor once you have enabled it in the Org settings. See Organization settings for more information.
The co-pilot is an experimental feature and is not guaranteed to always generate accurate Cypher queries. It is recommended to review the generated query before running it, especially if the query is meant to write to the database.
Some known limitations include:
-
Incorrect relationship direction.
-
Using deprecated Cypher syntax.
-
Tendency to not return relationships.