var documentsSchema = new Schema({
    "_project"          : {
        type : Schema.ObjectId, 
        ref  : 'Projects'
    },
    "_addedBy"          : {
        type : Schema.ObjectId, 
        ref  : 'Users'
    },
    "_associateUsers"   : [{
        type : Schema.ObjectId, 
        ref  : 'Users'
    }],
    "_codes"            : [{
        type : Schema.ObjectId, 
        ref  : 'Codes'
    }],
    "paragraphTitle"    : String,
    "paragraphText"     : String,
    "memos"             : [
    {
        "_addedBy"      : {
            type: Schema.Types.ObjectId, 
            ref: 'Users'
        },
        "memoData"      : String
    }
]});var codesSchema = new Schema({
"code" : {
    "_addedBy"      : {
        type    : Schema.ObjectId, 
        ref     : 'Users'
    },
    "codeText"      : String,
    "codeWeight"    : Number
}});I need to populate _codes.codeText (or codes fields) of the all elements of the array, but looks like I am not doing it properly.
Documents.find({
            "document._project": element._id
            }).
            populate('document._codes.code','code.codeText'). 
            exec(function (err, result) { .... }this and various tries with populate arguments are either not populating the fields or not returning any data.
What am I doing wrong?
My mongoose version is 3.8.16
populate('_codes.code','code.codeText').