I'm following along with this tutorial for Querying a feature layer using the ArcGIS JavaScript API, but using my own layer.

I am trying to query all features within the layer that have a value of 3 in the field called "mag". I'm supposed to get the length of the features in the query result when I console.log. This should not be 0.
But I am getting a result of 0, implying that I didn't get the query correct. What should my query statement query.where = "mag = 3"; be changed to here?
var query = new Query();
query.where = "mag = 3";
query.outfields = ["*"];
query.returnGeometry = true;
var queryTask = new QueryTask({
});
queryTask.execute(query)
.then(function(result) {
console.log(result.features.length)
})
.otherwise(function(e) {
console.log(e);
})
Thanks!