1
In Mongodb:
db.estr.createIndex({_id:1, Atualizar:-1});
In C#
var a = await db.dados.Distinct(x=>x.codigo).toListAsync();
var b = await db.estr.find(x=>!a.contains(x._id) && x.Atualizar).toListAsync();
Index Stats
{
"name" : "_id_1_Atualizar_-1",
"key" : {
"_id" : 1.0,
"Atualizar" : -1.0
},
"host" : "OMNIIS2012HOM:27017",
"accesses" : {
"ops" : NumberLong(0), <----- not utilizade
"since" : ISODate("2020-03-24T11:00:25.011-03:00")
}
}
x.Upgrading is Boolean