code: function addOrderByToRef(ref, orderBy) {
    if (!isArray(orderBy) && !isString(orderBy)) {
      throw new Error('orderBy parameter must be an array or string.');
    }
    if (isString(orderBy)) {
      return ref.orderBy(orderBy);
    }
    if (isString(orderBy[0])) {
      return ref.orderBy(...orderBy);
    }
    return orderBy.reduce(
      (acc, orderByArgs) => addOrderByToRef(acc, orderByArgs),
      ref,
    );
  }
docs: Add attribute to Cloud Firestore Reference handling invalid formats
  and multiple orderBy statements (array of arrays). Used for orderBy and where
  @param {firebase.firestore.Reference} ref - Reference which to add where to
  @param {Array} orderBy - Statement to attach to reference
  @param {String} [attrName='where'] - Name of attribute
  @return {firebase.firestore.Reference} Reference with where statement attached