Database
[{phrase:"This is phrase 1 of author 1",phraseLength:50,author:"Author 1",},{phrase:"This is phrase 1 of author 1",phraseLength:150,author:"Author 1",},{phrase:"This is phrase 1 of author 1",phraseLength:10,author:"Author 1",},{phrase:"This is phrase 1 of author 2",phraseLength:20,author:"Author 2",},{phrase:"This is phrase 2 of author 2",phraseLength:180,author:"Author 2",},{phrase:"This is phrase 3 of author 2",phraseLength:50,author:"Author 2",},]
Query
db.collection.aggregate([{$group:{_id:"$author",phrases:{$push:{phrase:"$phrase",phraseLength:"$phraseLength",author:"$author"}}}},{$set:{temp:{$reduce:{input:"$phrases",initialValue:{length:0,phrases:[]},in:{$cond:{if:{$lte:[{$sum:["$$this.phraseLength","$$value.length"]},200]},then:{length:{$sum:["$$this.phraseLength","$$value.length"]},phrases:{$concatArrays:[["$$this"],"$$value.phrases"]}},else:"$$value"}}}}}},{$set:{phrases:"$temp.phrases"}},{$unset:"temp"}])