【文件属性】:
文件名称:mongoose-lean-virtuals:将虚拟附加到猫鼬lean()查询的结果
文件大小:18KB
文件格式:ZIP
更新时间:2021-05-13 14:24:10
JavaScript
猫鼬瘦病毒
使用时,将虚拟函数附加到猫鼬查询的结果中。
。
用法
const mongooseLeanVirtuals = require ( 'mongoose-lean-virtuals' ) ;
// Example schema
const userSchema = new mongoose . Schema ( { name : String } ) ;
userSchema . virtual ( 'lowercase' ) . get ( function ( ) {
return this . name . toLowerCase ( ) ;
} ) ;
// Now, the `lowercase` property will show up even if you do a lean query
userSchema . plugin ( mongooseLean
【文件预览】:
mongoose-lean-virtuals-master
----.travis.yml(604B)
----index.js(5KB)
----package.json(2KB)
----test()
--------.eslintrc.yml(18B)
--------examples.test.js(4KB)
--------index.test.js(24KB)
----LICENSE(11KB)
----.npmignore(44B)
----.gitignore(902B)
----CHANGELOG.md(4KB)
----.npmrc(19B)
----examples.md(3KB)
----README.md(770B)
----HEADER.md(191B)