Mongodb – Possible to only query a sub document in Mongoose?
This is my test collection [ { "_id": "637cbf94b4741277c3b53c6c", "text": "outter", "username": "test1", "address": [ { "text": "inner", "username": "test2", "_id": "637cbf94b4741277c3b53c6e" } ], "__v": 0 } ] If I do t1 = await doc.find({}, 'text').exec(); console.log(JSON.stringify(t1, null, 2)); I…