Skip to content

Instantly share code, notes, and snippets.

@melvinkcx
Last active Jan 14, 2019
Embed
What would you like to do?
Enabling Virtuals In Mongoose Lean Mode (in a FeathersJs service)
// 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