Mongo Playground

Configuration

[{_id:1,books:[{bookId:55,c:5},{bookId:66,c:6},{bookId:77,c:7},]}]

Query

db.collection.aggregate({"$addFields":{"books":{"$map":{"input":"$books","as":"b","in":{"$cond":{"if":{"$eq":["$$b.bookId",55]},"then":{"$mergeObjects":["$$b",{"z":{"$sum":["$$b.c",1]}}]},"else":"$$b"}}}}}})

Result