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
// The number of books
json result2 = jsonpath::json_query(booklist, "length($..book)");
std::cout << "(2) " << result2 << "\n";
output is [1] as length gets passed an array of array and that outer array has value 1. But I think the examples like to output the number of books and not the number of result arrays.
I turned on a bit debugging:
length function arg: [[{"author":"Nigel Rees","category":"reference","price":8.95,"title":"Sayings of the Century"},{"author":"Evelyn Waugh","category":"fiction","price":12.99,"title":"Sword of Honour"},{"author":"Herman Melville","category":"fiction","isbn":"0-553-21311-3","price":8.99,"title":"Moby Dick"},{"author":"J. R. R. Tolkien","category":"fiction","isbn":"0-395-19395-8","price":22.99,"title":"The Lord of the Rings"}]]
(2) [1]
So either the example needs a new expression to query length value 4 or the code calling length needs to look into the array first?
The text was updated successfully, but these errors were encountered:
The examples does this:
output is [1] as length gets passed an array of array and that outer array has value 1. But I think the examples like to output the number of books and not the number of result arrays.
I turned on a bit debugging:
So either the example needs a new expression to query length value 4 or the code calling length needs to look into the array first?
The text was updated successfully, but these errors were encountered: