Default Scope for Queries?

57 views
Skip to first unread message

Greg Braman

unread,
Dec 4, 2014, 11:05:03 AM12/4/14
to mongoo...@googlegroups.com
Is it possible to define a default scope for queries in mongoose? For example, I want to mark users models as archived with a boolean called 'isArchived'. Is there a way to exclude these documents by default from my queries?

Valeri Karpov

unread,
Dec 4, 2014, 3:30:48 PM12/4/14
to mongoo...@googlegroups.com
Do you mean setting query defaults per model? Mongoose currently doesn't have a built-in method to do that
Reply all
Reply to author
Forward
0 new messages