7 - Using Iterators in query results


Hello, i'm trying to figuring out what is wrong with my code, here it is:

function iterateResults(){
var client = new Usergrid.Client({
//Initialize your client

//Setup your options object here. Remember to put your book's 
//author in the query!
var options = {
    qs: {"ql":"where author = 'Frank Herbert'"}

//Here is where we'll process the results of the query.
client.createCollection(options, function(error, books){
    while(books.hasNextEntity()) {
        //Put your call to .getNextEntity() below.
        var book = books.getNextEntity();
        //Get the book's title here!
        var title = book.get("title");



Can somebody help me?