Aggregate.prototype.option()
Parameters
options «Object» keys to merge into current options
number «[options.maxTimeMS]» limits the time this aggregation will run, see MongoDB docs on
maxTimeMS
boolean «[options.allowDiskUse]» if true, the MongoDB server will use the hard drive to store data during this aggregation
object «[options.collation]» see
Aggregate.prototype.collation()
ClientSession «[options.session]» see
Aggregate.prototype.session()
Returns:
- «Aggregate» this
Lets you set arbitrary options, for middleware or plugins.
Example:
const agg = Model.aggregate(..).option({ allowDiskUse: true }); // Set the `allowDiskUse` option
agg.options; // `{ allowDiskUse: true }`
当前内容版权归 mongoosejs 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 mongoosejs .