These are chat archives for Automattic/mongoose

13th
Aug 2015
Maksim
@chetverikov
Aug 13 2015 01:29
@devey Give me sample data and schemas.
@fayimora It's very strange. What version of mongoose you?
kapitanluffy p.
@kapitanluffy
Aug 13 2015 03:29
hi, it seems that there more people here than the irc chat. Anyway, is there a way to populate an unselected field in mongoose?
Yassine Sania
@devey
Aug 13 2015 10:47
@chetverikov solved, ty anyway!
ikcreddy
@ikcreddy
Aug 13 2015 11:13
Hi....

I have the Schema like this....
var userCategory = new Schema({

userCategorys :[
    {
        cName :  {
            type: String,
            default: '',
            trim: true,
            uppercase:true,
            required: 'Category Name cannot be blank'
        },
        created: {
            type: Date,
            default: Date.now
        },
        sCategory:[{
            sName:{
                type: String,
                default: 'Home',
                trim: true,
                required: 'Sub Category name cannot be blank'
            },
            sLinks:[{
                lName:String,
                links:String
            }]
        }],
    }
],
userID:{
    type: Schema.ObjectId,
    ref: 'User'
}

});

How do i save data into sCategory using userID and Category ID??

Could any one please help....
Fayi Femi-Balogun
@fayimora
Aug 13 2015 16:33
@chetverikov I’m using ^4.1.0
very strange indeed