Database

[{"credit":{credit:10},fromAdmin:true,type:"credit"},{"credit":{credit:10},fromAdmin:false,type:"others"}]

Query

db.collection.aggregate([{$project:{"_id":1,"credit":"$credit.credit","fromAdmin":1,"type":1,"description":{"$cond":{"if":{"$eq":["$fromAdmin",true]},"then":{$concat:["Admin Credit of ",{$toString:"$credit.credit"}," Credits"]},"else":{"$cond":{"if":{"$eq":["$type","credit"]},"then":{$concat:["Purchase of ",{$toString:"$credit.credit"}," Credits"]},"else":"Subscription Payment"}}}}}}])

Result