Database

[{_id:0,appointments:[]},{_id:1,appointments:[{_id:"A1",location:"",dateTimeStamp:[1,3],},{_id:"A2",location:"",dateTimeStamp:[5,10],},]},{_id:2,appointments:[{_id:"5",location:"",dateTimeStamp:[15,17],},{_id:"5",location:"",dateTimeStamp:[20,24],}]},]

Query

db.collection.aggregate([{$unwind:{path:"$appointments",preserveNullAndEmptyArrays:true}},{$addFields:{itemStart:{$arrayElemAt:["$appointments.dateTimeStamp",0]},itemEnd:{$arrayElemAt:["$appointments.dateTimeStamp",1]},}},{$addFields:{comboField:{$cond:{if:{$or:[{$eq:["$itemStart",null]},{$gt:[11,{$ifNull:["$itemEnd",9999999]}]},{$lt:[16,{$ifNull:["$itemStart",-9999999]}]},]},then:true,else:false}}}},{$group:{_id:"$_id",checks:{$push:"$comboField"},appointments:{$push:"$appointments"}}},{$match:{"checks":{$ne:false}}},{$project:{"checks":0}},{$project:{"appointments":{$concatArrays:["$appointments",[{location:"London",dateTimeStamp:[11,16]}]]}}},{$merge:{into:"collection",on:"_id",whenMatched:"merge"}}])

Result