Minimize in nested objects

38 views
Skip to first unread message

Attila Szirmai

unread,
Feb 26, 2015, 11:09:49 PM2/26/15
to mongoo...@googlegroups.com
Hi all,

I've searched for a general solution but have not found yet. Can I set mongoose to minimize documents by parts? I would like to minimize an embed document (nested object) if there is no data in it(s children), but I do not want to minimize the whole document (e.g. minimize: false in level 1 and minimize: true in level >1).

Thank you!

Have a nice day,
Attila

Valeri Karpov

unread,
Feb 28, 2015, 11:30:46 AM2/28/15
to mongoo...@googlegroups.com
Hmm you should be able to specify minimize: true in the child schema's toObject options. Does that not work?
Reply all
Reply to author
Forward
0 new messages