lib/relations/has_many_prefetch.js
function(instances) {
    var queryKey = this.foreignKey;
    var pks = _.map(instances, this.primaryKey);

    if (instances.length === 1) { pks = pks[0]; }
    else { queryKey += '$in'; }

    var where = _.object([[queryKey, pks]]);
    return this._relatedModel.objects.where(where);
  }
function(instances) {
    var queryKey = this.foreignKey;
    var pks = _.map(instances, this.primaryKey);

    if (instances.length === 1) { pks = pks[0]; }
    else { queryKey += '$in'; }

    var where = _.object([[queryKey, pks]]);
    return this._relatedModel.objects.where(where);
  }
function ( instances ) { var queryKey = this . foreignKey ; var pks = _ . map ( instances , this . primaryKey ) ; if ( instances . length === 1 ) { pks = pks [ 0 ] ; } else { queryKey += '$in' ; } var where = _ . object ( [ [ queryKey , pks ] ] ) ; return this . _relatedModel . objects . where ( where ) ; }
Generate the prefetch query.

Subclasses can override this.

@method
@protected
@see {@link HasMany#_prefetch}
Generate the prefetch query .