This can be achieved using the operator $concatin the aggregation pipeline.
db.testcoll.aggregate([{
$project: {
column1: {
$concat: ['prependstring', '$column1']
}
}
}]);
As indicated in the official MongoDB docs ( here ), the operator $concatonly works with strings.
source
share