wend try with this query, return the lookup is empty
db.getCollection(\'tests\').aggregate([
{$match: {typet:\'Req\'}},
{$project: {incharge:1}},
I finaly found the solution, is a problem with my Schema in mongoose with the ObjectId
I change this
var Schema = new Schema({
name: { type: String, required: true},
incharge: { type: String, required: true},
});
with this
var Schema = new Schema({
name: { type: String, required: true},
incharge: { type: mongoose.Schema.ObjectId, required: true},
});
and is working