Last active
January 14, 2019 15:08
-
-
Save melvinkcx/db2482cdbed7813e84febcc4811eda94 to your computer and use it in GitHub Desktop.
Enabling Virtuals In Mongoose Lean Mode (in a FeathersJs service)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// user.service.js | |
import createService from 'feathers-mongoose'; | |
// other imports... | |
export default (app) => { | |
const Model = createModel(app); | |
// ... | |
const options = { | |
Model, | |
lean: {virtuals: true}, // add this line | |
}; | |
const service = createService(options); | |
// ... | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment