Database
[{user:1,historicEnable:true,currentLocation:[],historicLocation:[]}]
Query
db.collection.update({user:1},[{$addFields:{location:[{"location":{"latitude":25,"longitude":35},"status":"safe"}]}},{$set:{historicLocation:{$cond:[{$eq:["$historicEnable",true]},{$concatArrays:["$historicLocation","$location"]},"$historicLocation"]},currentLocation:{$cond:[{$eq:["$currentLocation",false]},{$concatArrays:["$currentLocation","$location"]},"$currentLocation"]}}},{$unset:"location"}])