Aggregate.prototype.model()
Parameters
- [model] «Model» the model to which the aggregate is to be bound
Returns:
- «Aggregate,Model» if model is passed, will return
this
, otherwise will return the model
Get/set the model that this aggregation will execute on.
Example:
const aggregate = MyModel.aggregate([{ $match: { answer: 42 } }]);
aggregate.model() === MyModel; // true
// Change the model. There's rarely any reason to do this.
aggregate.model(SomeOtherModel);
aggregate.model() === SomeOtherModel; // true
当前内容版权归 mongoosejs 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 mongoosejs .