code: async function retrieveEntityByAttribute(
      entitySet,
      componentID,
      attribute,
      value
  ) {
      // Log.debug('[retrieveEntityByAttribute]', componentID, 'where', attribute, 'equals', value);
      const query = Q => [
          Q.all(componentID).where(Q.attr(attribute).equals(value)),
          Q.limit(1)
      ];
  
      if (entitySet.isAsync) {
          const existing = await entitySet.query(query, { debug: false });
  
          // Log.debug('[retrieveEntityByAttribute]', entityToString( existing));
          if (existing.size() === 1) {
              return existing.at(0);
          }
  
          return null;
      } else {
          return Promise.resolve(true).then(() => {
              const existing = entitySet.query(query);
              // Log.debug('[retrieveEntityByAttribute]', 'query result', existing.size(), entityToString(existing), componentID, attribute, value );
              if (existing.size() === 1) {
                  return existing.at(0);
              }
              return null;
          });
      }
  }
docs: Retrieves the first entity which has the specified component attribute value