Database

[{_id:ObjectId("61d67f0a74ec8620f34c57ed"),shot:[{shotId:"undefinedMKSf*Tf#!qHxWpz1hPzUBTz%",clubType:"driver",shotCount:20,_id:ObjectId("61d67f0a74ec8620f34c57ef"),createdAt:ISODate("2022-01-06T05:32:58.391Z")},{shotId:"undefinedMKSf*Tf#!qHxWpz1hPzUBTz%",clubType:"driver",shotCount:20,_id:ObjectId("61d67f0a74ec8620f34c57f0"),createdAt:ISODate("2022-01-08T05:32:58.391Z")},{shotId:"undefinedMKSf*Tf#!qHxWpz1hPzUBTz%",clubType:"passenger",shotCount:20,_id:ObjectId("61d67f0a74ec8620f34c57f1"),createdAt:ISODate("2022-01-08T05:32:58.391Z")}]}]

Query

db.collection.aggregate([{"$match":{_id:ObjectId("61d67f0a74ec8620f34c57ed"),"shot.clubType":"driver",shot:{$elemMatch:{$and:[{"createdAt":{$gte:ISODate("2022-01-07T05:32:58.391Z")}},{"createdAt":{$lte:ISODate("2022-01-09T05:32:58.391Z")}}]}}}},{"$set":{shot:{"$filter":{"input":"$shot","as":"s","cond":{$and:[{"$eq":["$$s.clubType","driver"]},{"$gte":["$$s.createdAt",ISODate("2022-01-07T05:32:58.391Z")]},{"$lte":["$$s.createdAt",ISODate("2022-01-09T05:32:58.391Z")]}]}}}}}])

Result