-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Float in Conditional Expression #52
Labels
Comments
Huh, wth. I'm guessing it's because it picks up the |
Yep. It picks the |
Done. JsonPath.new("$..book[?(@['price']== 8.95 || @['price']== 22.99)]").on(json)
=> [{"price"=>8.95, "category"=>"reference", "title"=>"Sayings of the Century", "author"=>"Nigel Rees"}, {"price"=>22.99, "category"=>"fiction", "isbn"=>"0-395-19395-8", "title"=>"The Lord of the Rings", "author"=>"Tolkien"}] |
Skarlso
added a commit
that referenced
this issue
May 9, 2017
@johnallen3d could you please have a go with the latest version mate? |
Woo hoo! Thanks! > JsonPath.new("$..book[?(@['price'] == 8.95 || @['price'] == 22.99)]").on(json)'] == 8.95 || @['price'] == 22.99)]").on(json)
=> [
{
"price" => 8.95,
"category" => "reference",
"title" => "Sayings of the Century",
"author" => "Nigel Rees"
},
{
"price" => 22.99,
"category" => "fiction",
"isbn" => "0-395-19395-8",
"title" => "The Lord of the Rings",
"author" => "Tolkien"
}
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm just getting around to trying out the conditional operators (thanks!) and found a potential bug. If i use the JSON example from the README that includes float values for book prices I get an error. More specifically, if I see an error when I try to use floats in the
JsonPath
expression.This doesn't appear to have anything to do with conditional operators. If I take the simple example from the README...
and try to use a float...
/cc @Skarlso
The text was updated successfully, but these errors were encountered: