function cast$all(val, context) {
  if (!Array.isArray(val)) {
    val = [val];
  }

  val = val.map((v) => {
    if (!utils.isObject(v)) {
      return v;
    }
    if (v.$elemMatch != null) {
      return { $elemMatch: cast(this.casterConstructor.schema, v.$elemMatch, null, this && this.$$context) };
    }

    const o = {};
    o[this.path] = v;
    return cast(this.casterConstructor.schema, o, null, this && this.$$context)[this.path];
  }, this);

  return this.castForQuery(null, val, context);
}
Add a virtual to this array. Specifically to this array, not the individual elements.

@param {String} name
@param {Object} [options]
@api private