var xtdb_db = connect("ip:port/实例名").getSisterDB("xtdb");
var back_db = connect("ip:port/实例名").getSisterDB("xtdb_del_back");
xtdb_db.auth("username","password");
back_db.auth("username","password");
var cursor = back_db.T_GroupMessage_Bak_202209.find({"_id":{$gte:ObjectId("5d19d616ef2e204a21754958")}});
var x = 0;
cursor.forEach(function(obj){
x++;
if((x%1000) == 0){
sleep(2000);
}
var id = obj._id;
xtdb_db.T_GroupMessage.deleteOne(
{"_id":id}
)
printjson("T_GroupMessage_Bak_202209:" + id);
})
x = 0;
cursor = back_db.T_Message_Bak_202209.find({"_id":{$gte:"5d19d616bd8c47879d186928"}});
cursor.forEach(function(obj){
x++;
if((x%1000) == 0){
sleep(2000);
}
var id = obj._id;
xtdb_db.T_Message.deleteOne(
{"_id":id}
)
printjson("T_Message_Bak_202209:" + id);
})