I have a field in mongodb document which is an array of integer as like:
import_ids=[5200, 4710, 100]
I want this array as double ## separated string, So that expected result would be
import_hashed="5200##4710##100"
I have tried with following code in $project pipeline of aggregation method.
{
$projct:{
import_hashed:{
$reduce:{
input:"$import_ids",
initialValue:"",
in:{$concat:["$$value", "##", "$$this"]}
}
}
}
}
But no result found and no erros too!