code: function addWhereToRef(ref, where) {
    if (!isArray(where)) {
      throw new Error('where parameter must be an array.');
    }
    if (isString(where[0])) {
      return where.length > 1 ? ref.where(...where) : ref.where(where[0]);
    }
  
    return where.reduce((acc, whereArgs) => addWhereToRef(acc, whereArgs), ref);
  }
docs: Add where claues to Cloud Firestore Reference handling invalid formats
  and multiple where statements (array of arrays)
  @param {firebase.firestore.Reference} ref - Reference which to add where to
  @param {Array} where - Where statement to attach to reference
  @return {firebase.firestore.Reference} Reference with where statement attached