Code entered correct but does not return results - 6/21


#1

the code entered for section 6 (Using Queries to find data in Apigee) looks correct, no errors are received but it does not return the data values (Book title & uuid) saved via the previous sections. I looked at the hints provided and my code matches but still does not return the expected values.

function queryAppServices(){
var client = new Usergrid.Client({
orgName:"xxxxx",
appName:"sandbox"
});
//Here is the name of your book
var title ="";
//Setup the query options object
var options = {
type: "book",
qs : {"ql": "where title = '"+title+"'"}
};
//Create collection will give back a collection of objects that
//conform to your query.
client.createCollection(options, function(error, books)
if(error) {
$("#response").append("Error");
}
else
{
//Get the first entity of the collection here.
var firstBook = books.getFirstEntity()
//Use the get() function to get the title of your book here
var title = firstBook.get("title");
//Use the get() function to get the uuid of your book here
var uuid = firstBook.get("uuid");
$("#response").append("Your book title is:"+title+" it's uuid is:"+uuid);
}
});
}


#2

You have to put the title of your book in here
/Here is the name of your book
var title =""; < -------------
Like this
var title="Dune";


#3

I'm having the same issue. I entered the correct code and it refuses to work.