Mongoose We could not find a proper typescript generic to support nested queries

Iam trying to customize one query object based on some attributes.The following code fragments stucks at the second function of async.waterfall. What iam trying to do is to achieve dot notation inside mongoose query filtering. If i hover my cursor on a filter attribute like userID then it shows me Mongoose We could not find a proper typescript generic to support nested queries .If my query did not have $gte specification,then if i put just the query object as argument instead of using dot notation, then it works.But becasue i have the specification with the date_started, i have not find any solution yet. Basically, my first query findOneAndDelete returns null.Below is my code. Any suggestion? Thanks

exports.bookdeletepostcontroller=function (req,res,next){
    if(req.userData.role=="admin"){
        var  query = {};
        query.userID
        query._id = mongoose.Types.ObjectId(req.params.id);
        query.date_started=0;

    }
    else{
        var query={};
        query.userID=mongoose.Types.ObjectId(req.userData.id);
        query._id=mongoose.Types.ObjectId(req.params.id);
        query.date_started=Date.now()+3600000;
    }
    async.waterfall([function (callback){
        booking.findOneAndDelete({_id:query._id,userID:query.userID,date_started:{$gte:query.date_started}},{projection:{resourceID:1}},function (err,booking_found){
            if (err){callback(err,null); return;}
            callback(null,booking_found)
        });
    },function (found,callback){
        console.log("this is resource id"+found.resourceID);
        resource.update({_id:found.resourceID},
            {$pull:{reservation:{BookingsID: mongoose.Types.ObjectId(req.params.id)}}},function (err){
                if (err) {
                    callback(err, null);
                    return;
                }
                console.log(found);
                callback(null);
            });
    }
    ], function (err,result){
        if (err){return next(err);}
        else {res.render('book failed',{title:"Book successfully deleted",role:req.userData.role});}
        }

    )