Database

[{"Name":"Aruba","Code":"ABW","Type":"Country","IndicatorName":"Military_expenditure","1900":0,"1961":1,"1962":0,"1963":0,"1964":0,"1965":0,"1966":0,"1967":0,"1968":0,"1969":0},{"Name":"Afghanistan","Code":"AFG","Type":"Country","IndicatorName":"Military_expenditure","1900":0,"1961":100,"1962":0,"1963":0,"1964":0,"1965":0,"1966":0,"1967":0,"1968":0,"1969":0}]

Query

db.collection.aggregate([{$project:{_id:0,Name:1,years:{$filter:{input:{$objectToArray:"$$ROOT"},cond:{$and:[{$gte:["$$this.k","1900"]},{$lte:["$$this.k","2020"]}]}}}}},{$group:{_id:"$Name",total:{$sum:{"$sum":"$years.v"}}}}])

Result