code: function checkObject (obj) {
    if (util.isArray(obj)) {
      obj.forEach(function (o) {
        checkObject(o);
      });
    }
  
    if (typeof obj === 'object' && obj !== null) {
      Object.keys(obj).forEach(function (k) {
        checkKey(k, obj[k]);
        checkObject(obj[k]);
      });
    }
  }
docs: Check a DB object and throw an error if it's not valid
  Works by applying the above checkKey function to all fields recursively