The mx.data.getOffline API allows data retrieval through JavaScript in offline apps.
Currently the API has no way to search for null or empty values, for example objects that don't have an association set.
Adding an isEmpty operator to the API would allow searching for objects that don't have a certain association set.
The call could look like this:
mx.data.getOffline("MyFirstModule.Pet", [{
attribute: "MyFirstModule.Pet_Person",
operator: "isEmpty"
}], {}, function(mxobjs, count) {
console.log("There are " + count + " pets that currently have no owner");
});