These are chat archives for Automattic/mongoose

25th
Mar 2017
cflist
@cflist
Mar 25 2017 16:29
I get this error and not sure why... .find(...).then is not a function . I use q as promise
Varun Jayaraman
@varunjayaraman
Mar 25 2017 17:50
@cflist can i see how you use .find().then()?
@valtido when we say you can use mongoose in the browser, you obviously cant use stuff like Schema.find() because it's the browser. but you can create mongoose documents and share validation on mongoose documents. SO if you have some document created by new mongoose.Document(someObject, someSchema), that document in the browser will automatically populate with the fields from the schema without you having to define it like:
const doc = { profile: { name: string } } // etc...
you'd also have access to virtuals and methods
so like
if you had a virtual fullName you could do doc.fullName in the browser
but you can't use query operators. Those don't make sense in the browser
cflist
@cflist
Mar 25 2017 19:56
@varunjayaraman I was using mongoose 3.8, updated to later version solved it. guessing 3.8 didnt have promises et
Varun Jayaraman
@varunjayaraman
Mar 25 2017 20:22
Ok cool