adriank / ObjectPath

The agile query language for semi-structured data
http://objectpath.org
MIT License
380 stars 93 forks source link

Cannot return the whole document #69

Closed ales004 closed 5 years ago

ales004 commented 5 years ago

If I want to get back the whole document, I get an error. Here the code:

ee = objectpath.Tree({'aa':'bb', 'cc': {'ee':'11', 'rr': '33'}})
ee.execute("$.cc") --> works
ee.execute("$")  --> throws exception "StopIteration"
adriank commented 5 years ago

You need to use $.* to select all nodes.

On Thu, 18 Oct 2018 at 15:16 Alessandro Seganti notifications@github.com wrote:

If I want to get back the whole document, I get an error. Here the code:

ee = objectpath.Tree({'aa':'bb', 'cc': {'ee':'11', 'rr': '33'}}) ee.execute("$.cc") --> works ee.execute("$") --> throws exception "StopIteration"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/adriank/ObjectPath/issues/69, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKyclgrXAQRRMMxgktbOQ-nc7vQ6I0Aks5umH9CgaJpZM4Xtalc .

-- Greetings, Adrian Kalbarczyk

http://kalbarczyk.co