Neo4j DevTools – Better in Neo4j Workspace


For the last few months, we’ve been toiling away to bring you a more cohesive and integrated developer experience in Neo4j Workspace. Workspace gives you access to your graph tools in one coherent place and is available now in Aura Free and Professional.

This update full of goodness is long overdue, so read on to hear about the latest and greatest things we’ve been working on. And if you haven’t already, check it out for real with your own free Aura instance.

Workspace – Query

First off, Query is part of Workspace that will ultimately replace the much-loved Neo4j Browser. With Workspace we’re not just rebuilding the same capability, we’re improving things as we go. Here is the low down on some familiar features that have been improved in Query.

🎯 Refreshed: Param Support

When working with parameters in your application code, testing them out in Browser is a great way to ensure things are working just as you want them to. However, in Browser the :param and :params commands are a little finicky, working slightly differently and the latter often leading to unpredictable data types in your parameter set.

In Query, there’s now just a single :param command (though :params is aliased to :param for convenience) which supports two ways of expressing parameters. The first is using object syntax to conveniently declare many parameters at once, for example:

Setting multiple parameters

And the arrow syntax is also supported if you just want to declare one parameter. Note that declarations are additive.

Setting a single parameter, showing additive nature

Both ways of defining parameters are now evaluated in a Cypher RETURN statement to ensure you get the correct Neo4j types you are expecting, something which wasn’t guaranteed before. You can find more help on parameters in-product by running the :param command. The latest versions of cypher-shell have also been updated to adopt the same syntax to make them more portable.

💾 Saved Cypher

What used to be termed favorites in Browser has been reimagined as Saved Cypher. You’ll find a more predictable UI for saving and organising your most essential Cypher statements.

Saved Cypher can be created from the result frames via the bookmark icon in the editor, optionally specifying a folder to keep things well organised.

Create Saved Cypher

In the sidebar you’ll find your Saved Cypher itemised with options to edit and reorganise things just as you like them.

You’re able to export and import Saved Cypher in CSV format too. This export format gives you a good way to add saved Cypher to a version-controlled backup.

If you want to edit the exported CSV manually, I highly recommend using VS Code’s Edit CSV extension. Less developer focussed apps such as Excel or Google Sheets can wreak havoc with escaping, delimiters, and general formatting so do bear this in mind if you find editing the exported output useful.

Edit CSV VS Code plugin

For the time being, Saved Cypher statements continue to be stored in your web browser’s local storage, but we’re working on more reliable storage — watch this space.

🏎️ Powered-up Graph Visualization

Now available in Query is an improved graph visualization and its accompanying details panel. The graph visualization is now powered by the same engine as Explore (aka Bloom), providing better performance for larger graphs while retaining the same layout you know and love from Browser. You can enable it by clicking the experimental toggle lab flask in the bottom left of any visualization before we make it the default. To get a feel for the difference, check out a performance comparison of old and new on a mid-sized graph below:

Old graph visualization
New graph visualisation

🕵️ New Plan View Options

The familiar plan view from Browser has been given a new lick of paint to help you understand the performance of your queries.

As before, prefix your queries with EXPLAIN or PROFILE to get the plan view. You’ll also find a new option to view the plan view in text format, handy for sharing some of the finer details via text.

Plan view

🔎 Quick History Search

Have you ever been frantically hitting the up and down arrows to find that critical query in your history? Well, now you can call on a quick search to find it. Just hit Ctrl+R on Mac/Linux and F9 on Windows to invoke it. You can edit or execute the statements found with the fuzzy search.

We’ll soon be bringing you a new history sidebar where you can view, manage and export your query history too.

Workspace – Import

📄 File Filtering

We now support the ability to pre-filter files used in an import job, allowing you to execute more loads without the need for pre-processing.

When mapping files to nodes and relationships, you’ll notice an optional filter file toggle. By specifying a row-column, you can choose which row values should be kept based on an exact string match:

Example filtering to keep only ORDERS relationships from a larger relationships file

This can be especially useful when you have node or relationship files each containing many nodes or relationships pertainign to different parts of your model.

🛑 Stop Import

And finally, a long overdue feature is the ability to stop an import job on request, handy if you’ve prematurely started an import job and want to cancel it part way through. The import button now consolidates the handy progress bar too.

Closing Thoughts

That’s all for this installment, I look forward to bringing you DevTools updates more regularly again. To all Aura Free and Professional users, we hope you enjoy the latest and greatest versions of our tools. If you have any feedback or requests, we’d love to hear from you over at:

https://feedback.neo4j.com/query for Query

https://feedback.neo4j.com/data-importer for Import

As the year progresses, we’ll be working to make Query and Import available to more users outside of Aura, so stay tuned for more updates on that.


Neo4j DevTools – Better in Neo4j Workspace was originally published in Neo4j Developer Blog on Medium, where people are continuing the conversation by highlighting and responding to this story.