Articles → MONGODB → $Concat Aggregation Operator In Mongodb

$Concat Aggregation Operator In Mongodb






Purpose





Example




Picture showing the sample document collection




db.Employees.aggregate([
  {
    $project: {
      fullName: { $concat: ["$firstname", " ", "$lastname"] }
    }
  }
])



Output


Picture showing the output of $concat aggregation operator in mongodb





Posted By  -  Karan Gupta
 
Posted On  -  Monday, June 3, 2024

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250