mongoose - Array is not populated -


below code retrieving data.

var userschema = new mongoose.schema({      name: string,     uniqueid: string,     userid: string,     creater_id: string,     enquiryid: {type: [mongoose.schema.types.objectid], ref: 'enquirys'},     rptoken: {type: string, default: ''}  }); 

and mongo query

user.find({}).populate('enquiryid').exec(function (err, data) {     res.json({'success': true, message: '', data: data}); }) 


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -