Specifying select : false on array of subdocuments in Schema

后端 未结 1 1730
青春惊慌失措
青春惊慌失措 2021-01-13 23:06

I\'m looking for help on the proper syntax for turning off select of property which is an array of subdocuments. I was hoping for something along these lines:



        
相关标签:
1条回答
  • 2021-01-13 23:32

    I came up with a similar problem and solved it using the slightly altered syntax below

    var UserSchema = new Schema(
        {  
            fb_id       : Number, 
            children    : { type: [CustomChildSchema], select:false}
        }
    )
    
    0 讨论(0)
提交回复
热议问题