Skip to content

Instantly share code, notes, and snippets.

@melvinkcx
Last active January 14, 2019 15:08
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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