Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
11-14-2022 05:12 AM
Hello,
when I run this code
Solved! Go to Solution.
11-14-2022 02:29 PM
11-14-2022 05:40 AM
How long does it take to run just the json request?
11-14-2022 07:13 AM - edited 11-14-2022 07:56 AM
Thanks for your response
it takes 5 ms
11-14-2022 08:48 AM
That is very fast. How about you run the following:
call apoc.load.jsonParams(uri, options,null)
YIELD value AS listing
MERGE (l:Listing{cid:0})
I am trying to figure out if it is the parsing of the json? Even so, your path is not complicated, so I can't image it taking that long to pull out the value of 'listing.results[0].listing_id'. How complicated is the listing json? Can you share it?
11-14-2022 09:26 AM
I tried it without apoc by creating variable and works quickly
like that :
with ['lst_00000355','lst_00000034b965'] as results
UNWIND results as row
MERGE(l:Listing{clid:row})
but when I use it with apoc
it becomes too slow
json sample : {
key1:"some value"
results: [
{
"listing_id" : 'da312312',
"price_id" : 'prc_231451'
}
]
}
and I use results only .
11-14-2022 10:01 AM
Something seems very off. I used the apoc method to pull orders from a Shopify site I have and then pull out some data from the response. The json is fairly large and the response was instantaneous.
11-14-2022 10:05 AM
can u please show the code of that ?
11-14-2022 11:44 AM
Here it is, but I had to remove my api key information, so you will not be able to call it and get back a response.
call apoc.load.jsonParams('https://xxxx:@yyyy.myshopify.com/admin/api/2021-01/orders.json?fields=created_at,id,name,note_attributes,line_items,customer,tags,shipping_address,shipping_lines,order_status_url,financial_status,fulfillment_status,note,source_name,total_line_items_price,total_tax,total_price,total_discounts&status=open&financial_status=paid,pending&fulfillment_status=partial,null&limit=250',{},null) yield value
return value.orders[9].order_status_url
11-14-2022 02:29 PM
Thanks a lot
we solved it by creating unique constraints 🙂
11-14-2022 02:31 PM
That would speed up the merge, since it will also create an index.
Great you got it working.
11-14-2022 10:28 AM
When I am not using apoc it works with indexes and when I use apoc it hits on all node (doesn't use indexes)
All the sessions of the conference are now available online