These are chat archives for Automattic/mongoose

11th
Feb 2017
Justin Ho
@mrchess
Feb 11 2017 05:29
I just use a "verified" flag in the User collection
Anyone know if you can get populate() on virtuals to return single objects, and not arrays all the time?
Justin Ho
@mrchess
Feb 11 2017 05:35
I figured it out. there is a justOne property :)
Ayush Bahuguna
@relentless-coder
Feb 11 2017 17:10

Hi, I am new to Mongoose. I have a question.

var Kitten = mongoose.model('Kitten', kittySchema);

in the above code, does the var name and the term inside the model has to be the same?
would

var kitty = mongoose.model('Kitten', kittySchema)

be correct?
and later I'd use

var furry = new kitty({name: 'furr'});