I\'m running this code on node.js
var mongoose = require(\'mongoose\');
mongoose.model(\'participant\',new mongoose.Schema({},{ collection : \'forumParticipa
I suspect the value you are trying to get is not in your Schema but is stored in your database.
You have two solutions from there. You can either add entity_id to your Schema and Mongo will be able to bind it to the Document object you receive. This is the recommended way.
Or you can bypass mongoose Schema and access the raw document stored in the database with docs[0]._doc.entity_id. I don't recommend this solution unless you know what you're doing.