code: function (identifier) {
              var self = this;
  
              // Search for Lookup records associated with the identifier (id, macAddress, ipAddress).
              return waterline.lookups.findByTerm(identifier).then(function (documents) {
                  // Identify a record with a node id.
                  var lookup = _.find(documents, function (item) {
                      return item.node !== undefined;
                  });
                  // If we find a record with a node id then we can lookup the node with it,
                  // otherwise we can try to lookup with the identifier directly.
                  if (lookup) {
                      return self.findOne({ id: lookup.node });
                  } else {
                      return self.findOne({ id: identifier })
                      .then(function(rec) {
                          if(!rec) {
                              return self.findOne({identifiers: identifier});
                          }
                          return rec;
                      });
                  }
              });
          }
docs: Look up by identifier - either the "id" or in the identifiers array.
  Returns a waterline (bluebird) promise that will resolve the promise.
  
  @param {string} identifier
  @returns {Deferred}