You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use gojsonq to make some queries to JSON data. I was setting up some tests that were returning nil when I tried to validate the data inside of the JSON object. Eventually, I noticed if I do multiple Finds, it starts returning nil.
Yes, it's expected. Query it's like a chain if you move forward you can't automatically return back to previous state.
There is Reset/0 method.
Although it would be great to have opportunity save current state and return not only to start point.
Thanks @Kvaz1r, that's what I was looking for! Maybe for Find it automatically resets since it seems like users won't really be building queries with that?
Yeah, an efficient reset would be nice here for uses cases where we want to initialize the query object given a map and then just query for specific values given their paths many times.
I'm trying to use gojsonq to make some queries to JSON data. I was setting up some tests that were returning
nil
when I tried to validate the data inside of the JSON object. Eventually, I noticed if I do multipleFind
s, it starts returningnil
.Here's an example of the behavior: https://play.golang.org/p/qxiooDmflIe
Is this expected? I couldn't find a way in the documentation to run the same query multiple times and get the same data back.
The text was updated successfully, but these errors were encountered: