-2

I'm trying to load a json document into Neo4j but, if possible, I don't want to use a file because, in my case, it's a waste of time.

WHAT I'M DOING NOW:

  1. Python query to Elasticsearch Database
  2. Push data into a .json file
  3. From Neo4j Python Library, run apoc.load.json('file:///file.json')

WHAT I WANT TO DO:

  1. Python query to Elasticsearch Database
  2. From Neo4j Python Library, run apoc.load.json()

Is there any syntax that could help me with that? Thank you

sicdb
  • 23
  • 4

1 Answers1

0

If you already have APOC installed, you can utilize the APOC to ES connector without having to use apoc.load.json.

Here is an example from the documentation:

CALL apoc.es.query("localhost","bank","_doc",null,{
  query: { match_all: {} },
  sort: [
    { account_number: "asc" }
  ]
})
YIELD value
UNWIND value.hits.hits AS hit
RETURN hit;

Link to docs: https://neo4j.com/labs/apoc/4.1/overview/apoc.es/

Tomaž Bratanič
  • 6,319
  • 2
  • 18
  • 31