Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mongoose virtuals #12

Closed
henksmeba opened this issue Jan 6, 2014 · 3 comments
Closed

mongoose virtuals #12

henksmeba opened this issue Jan 6, 2014 · 3 comments

Comments

@henksmeba
Copy link

Looks like virtual selection isn't possible. Or maybe i'm doing something wrong.

@eherve
Copy link
Owner

eherve commented Jan 6, 2014

Hello,
Thank you for using the module.

The virtuals are not stored in the database, they are mongoose model based fields (aliases or function return values added on the mongoose document). The module fetch the data with an aggregate so the concept of mongoose document is lost and an aggregate is returned.

If you need the field, re-build the virtuals after the fetch by adding it in the data from data.aaData or directly in the client by fetching the needed values and using a mRender function.

I hope this answer your question, if you need anything else let me know.

@henksmeba
Copy link
Author

Hi,
thanks for the quick response (and the module). I've solved the problem by generating the data on the client in the mRender function.

@eherve
Copy link
Owner

eherve commented Jan 6, 2014

You are welcome !
Thank you for your feedback.

@eherve eherve closed this as completed Jan 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants