These are chat archives for Automattic/mongoose

22nd
Apr 2017
gustojs
@gustojs
Apr 22 2017 14:40
guys, a lame question from a newbie who failed to google it. let's say i have a schema and in the schema, i want to perform a custom validation against something in the database. but everywhere i look, it's said that to do mongo operations i need the mongoose model. i can't call a model in a schema, because the model doesn't exist yet, and i fail to find a way to create the model first and then apply the schema to it. how do you guys deal with that?
gustojs
@gustojs
Apr 22 2017 14:53
well, for now i worked around the issue by using a plugin that does the query i wanted to do out of the box. but i'd still like to learn a way to deal with that in the future