I use mongoose driver in node js. My schema:
let sendResultSchema = mongoose.Schema({
emailId: String, email: String,
letterId: String
If you don't need all the fields in the record you can make the query faster by returning just the necessary fields. Like;
db.sendresults.find({"tag" : "tagValue", "letterId" : "5ad630b5949bb02ea07d15d1"},{"_id":0,"tag":1,"email":1}).sort({emailId: -1}).limit(1)
exp. Making field equal to one means returning that field. I made "_id : 0" because I didn't want to get id of the record in mongodb. If you don't add "_id:0" to query it is gonna return the id automatically.
While working with a record with more and nested fields, it saved me a lot of time.