How do I export Cypher Favorites recorded in the browser

Cypher Favorites are common Cypher statements which one can save to the left panel of the Neo4j browser. A Favorite is created by entering the Cypher at the top prompt and then clicking the Favorite icon to the right as depicted:

image

After clicking on the Favorite Icon, the title of the Cypher statement (in this case ‘my favorite Cypher’) will be added to the left panel of the browser. For example:

image

These favorites are stored in local browser storage and as such are centric to the user/browser who has recorded those favorites. Additionally, if one clears their browser cache, recorded favorites will be removed.   To export favorites, use the Developer Console of Google Chrome and connect to the Neo4j browser URL.

  1. Launch Google Chrome and connect to the Neo4j browser on http://localhost:7474
  2. Access the Developer Console, https://developer.chrome.com/devtools/docs/console within Google Chrome 
    • Use the keyboard shortcut kbd:[Command  Option  J] (Mac) or kbd:[Control+ Shift + J] (Windows/Linux).
  3. Enter the following in the Developer Console and hit return
var res = JSON.parse(localStorage.getItem('neo4j.documents')) 
for (x in res) {
  console.log(res[x]['content'])
}

  4. Your output should be similar to the following, which lists the statements to recreate your Favorites   image ”’

  • Last Modified: 2020-09-30 15:12:37 UTC by Dana Canzano.
  • Relevant for Neo4j Versions: 3.5.
  • Relevant keywords cypher,browser.