MongoDB GeoNear - ReferenceError: message is not defined

This error is thrown with the following code. It was previously working but now is not.

var params;

params = {
  geoNear: 'locations',
  near: [coords.longitude, coords.latitude],
  spherical: true,
  distanceMultiplier: 6378160.0
};

db.mongo.command(params, function(err, near) {
  if (err) {
    console.log(err);
  }
});

Any idea what could be causing this error?