Maybe you can change abit the hard codded conditions as follow:
mongos> const cond= [ {thread_id:1 ,$or:[ {date:{$lte:1899}} ,{date:{$gte:2059}}] },{thread_id:2 ,$or:[ {date:{$gte:2000}} ,{date:{$lte:1905} } ] } , {thread_id:3 , $or:[ {date:{$lte:1905}}, {date:{$gte:9999}}]} ]
mongos> db.updates.find({$or:cond})
{ "_id" : ObjectId("5ff9b208da146da4e1359dcf"), "thread_id" : 2, "text" : "This is a test", "date" : 3000 }
mongos> db.updates.find()
{ "_id" : ObjectId("5ff9b208da146da4e1359dcf"), "thread_id" : 2, "text" : "This is a test", "date" : 3000 }
{ "_id" : ObjectId("5ff9b399da146da4e1359dd1"), "thread_id" : 1, "text" : "Hello", "date" : 2000 }
{ "_id" : ObjectId("5ff9b3aada146da4e1359dd2"), "thread_id" : 2, "text" : "GoodBye!", "date" : 1999 }
{ "_id" : ObjectId("5ff9b3c6da146da4e1359dd3"), "thread_id" : 3, "text" : "We are happy!", "date" : 6000 }
mongos> db.updates.find({$or:cond})
{ "_id" : ObjectId("5ff9b208da146da4e1359dcf"), "thread_id" : 2, "text" : "This is a test", "date" : 3000 }
mongos> db.updates.deleteMany({$or:cond})
{ "acknowledged" : true, "deletedCount" : 1 }
mongos> db.updates.find()
{ "_id" : ObjectId("5ff9b399da146da4e1359dd1"), "thread_id" : 1, "text" : "Hello", "date" : 2000 }
{ "_id" : ObjectId("5ff9b3aada146da4e1359dd2"), "thread_id" : 2, "text" : "GoodBye!", "date" : 1999 }
{ "_id" : ObjectId("5ff9b3c6da146da4e1359dd3"), "thread_id" : 3, "text" : "We are happy!", "date" : 6000 }
mongos>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…