New to JSONIQ,and using zorba what I want to do so far is to extract some information from an indexed object in an object array in JSONIQ. Here's the code so far.
jsoniq version "1.0";
let $bstore:={
"bookstore":
{
"book":[
{
"category":"cooking",
"title":"Everyday Italian",
"author":"Giada De Laurentiis",
"year":"2005",
"price":"30.00"
},
{
"category":"web",
"title":"XQuery Kick Start",
"author":["James McGovern","Per Bothner","Kurt Cagle","James Linn","Vaidyanathan Nagarajan"],
"year":"2003",
"price":"49.99"
}
]
}
}
for $o in $bstore.bookstore
let $a:=$o.book
return $a.title
What I'm trying to do is to return the title,author,and price of the books. I am able to return the array but whenever I type the index.
let $a:=$o.book[1].title
return $a
I get no results. My expected output would be
Everyday Italian
Any help would be much appreciated.