定義
$concat文字列を連結し、連結された文字列を返します。
$concatの構文は次のとおりです。{ $concat: [ <expression1>, <expression2>, ... ] } 引数は、string に変換される限り、どのような有効な式でも使用できます。 式の詳細については、「式 」を参照してください。
引数が
nullの値に解決されるか、欠落しているフィールドを参照する場合、$concatはnullを返します。
例
これらのドキュメントを使用してinventoryコレクションを作成します。
db.inventory.insertMany( [    { _id : 1, item : "ABC1", quarter: "13Q1", description : "product 1" },    { _id : 2, item : "ABC2", quarter: "13Q4", description : "product 2" },    { _id : 3, item : "XYZ1", quarter: "14Q2", description : null } ] ) 
$concat演算子を使用して、 itemフィールドとdescriptionフィールドを "-" 区切り文字で連結します。
db.inventory.aggregate(    [       { $project: { itemDescription: { $concat: [ "$item", " - ", "$description" ] } } }    ] ) 
出力:
{ _id : 1, itemDescription : "ABC1 - product 1" } { _id : 2, itemDescription : "ABC2 - product 2" } { _id : 3, itemDescription : null }