Document.prototype.toJSON()
Parameters
- options «Object»
Returns:
- «Object»
The return value of this method is used in calls to JSON.stringify(doc).
This method accepts the same options as Document#toObject. To apply the options to every document of your schema by default, set your schemas toJSON
option to the same argument.
schema.set('toJSON', { virtuals: true })
See schema options for details.
当前内容版权归 mongoosejs 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 mongoosejs .