Database
[{name:"Hello World",tags:["simple","easy"]}]
Query
db.collection.aggregate([{"$addFields":{"tags":{"$reduce":{"input":"$tags","initialValue":"","in":{"$concat":[/**add the running concatination of this array to the front*/"$$value",/**add the current value after that*/"$$this",{/**comma. if current index is the last element, don't add a comma to the end.*/$cond:{if:{"$eq":[{$subtract:[{$size:"$tags"},1]},{$indexOfArray:["$tags","$$this"]}]},then:"",else:","}}]}}}}}])