Hello Yaniv,
Sorry for delay. Please make a query with where = '{"InStock":"Shop"}'
and with include = ItemRef, ItemRef.ItemId
You will get in response something like
precode[
{
"id":"5446bc42e4b03d005b61b704",
"Name":"TargetBuyerA",
"createdAt":"2014-10-21 20:04:18.775",
"updatedAt":"2014-10-21 20:05:32.851",
"InStock":"Shop",
"ItemRef":{
"id":"5446bb80e4b03d005b61b6fe",
"Name":"Dril",
"createdAt":"2014-10-21 20:01:04.458",
"updatedAt":"2014-10-21 20:01:13.126",
"ItemId":{
"id":"5446bb72e4b03d005b61b6fd",
"Name":"Electric",
"createdAt":"2014-10-21 20:00:50.467",
"updatedAt":"2014-10-21 20:00:50.467"
}
}
},
{
"id":"5446bc5ae4b03d005b61b705",
"InStock":"Shop",
"createdAt":"2014-10-21 20:04:42.815",
"updatedAt":"2014-10-21 20:22:12.343",
"ItemRef":{
"id":"5446bb9ae4b03d005b61b700",
"ItemId":{
"id":"5446bb72e4b03d005b61b6fd",
"Name":"Electric",
"createdAt":"2014-10-21 20:00:50.467",
"updatedAt":"2014-10-21 20:00:50.467"
},
"createdAt":"2014-10-21 20:01:30.027",
"updatedAt":"2014-10-21 20:02:15.039",
"Name":"Lawn Mower"
},
"Name":"TargetBuyerB"
},
{
"id":"5446bca8e4b03d005b61b707",
"ItemRef":{
"id":"5446bb9de4b03d005b61b701",
"ItemId":{
"id":"5446bc17e4b03d005b61b703",
"Name":"Manual",
"createdAt":"2014-10-21 20:03:35.863",
"updatedAt":"2014-10-21 20:03:35.863"
},
"createdAt":"2014-10-21 20:01:33.834",
"updatedAt":"2014-10-21 20:03:55.322",
"Name":"Screwdriver"
},
"createdAt":"2014-10-21 20:06:00.676",
"_updatedAt":"2014-10-21 20:06:11.643",
"Name":"TargetBuyerD",
"InStock":"Shop"
}
]/code/pre
As a result you get the whole info for one request. Running in a loop you may form data in the desired form.