Вы можете использовать запрос на обновление;
db.test.update({"TRANSACTION_ID" : "0:ffff0a0a0983UY:-142"},{"$set" : {"DENSE_RANK" : 1}},{multi : true})
и
db.test.update({"TRANSACTION_ID" : "ffff0a0a0983UY:-111"},{"$set" : {"DENSE_RANK" : 2}},{multi : true})
Вывод:
{
"_id" : ObjectId("5bd188c34caa61c57872dbe7"),
"TRANSACTION_ID" : "0:ffff0a0a0983UY:-142",
"CREATE_DATE" : "Fri Sep 07 16:51:29IST2018",
"DENSE_RANK" : 1.0
}
{
"_id" : ObjectId("5bd188c34caa61c57872dbe8"),
"TRANSACTION_ID" : "0:ffff0a0a0983UY:-142",
"CREATE_DATE" : "Fri Sep 07 16:51:29IST2018",
"DENSE_RANK" : 1.0
}
{
"_id" : ObjectId("5bd188c34caa61c57872dbe9"),
"TRANSACTION_ID" : "0:ffff0a0a0983UY:-142",
"CREATE_DATE" : "Fri Sep 07 16:51:29IST2018",
"DENSE_RANK" : 1.0
}
{
"_id" : ObjectId("5bd189044caa61c57872dbec"),
"TRANSACTION_ID" : "ffff0a0a0983UY:-111",
"CREATE_DATE" : "Fri Sep 06 16:51:29IST2018",
"DENSE_RANK" : 2.0
}
{
"_id" : ObjectId("5bd189044caa61c57872dbed"),
"TRANSACTION_ID" : "ffff0a0a0983UY:-111",
"CREATE_DATE" : "Fri Sep 06 16:51:29IST2018",
"DENSE_RANK" : 2.0
}