Aggregate.prototype.unwind()
Parameters
- fields «String|Object» the field(s) to unwind, either as field names or as objects with options. If passing a string, prefixing the field name with ‘$’ is optional. If passing an object,
path
must start with ‘$’.
Returns:
- «Aggregate»
Appends new custom $unwind operator(s) to this aggregate pipeline.
Note that the $unwind
operator requires the path name to start with ‘$’. Mongoose will prepend ‘$’ if the specified field doesn’t start ‘$’.
Examples:
aggregate.unwind("tags");
aggregate.unwind("a", "b", "c");
aggregate.unwind({ path: '$tags', preserveNullAndEmptyArrays: true });
当前内容版权归 mongoosejs 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 mongoosejs .