Transform field in MongoDB aggregate

Viewed 456

I have a some query on mongodb via aggregate, I can get the result I want and sent to client. After this I need to be merge file name and file url.

My results

{
  "_id" : "1", "name" : "x", "image" : "y.jpg"
}

But I want to edit results like this

{
  "_id" : "1", "name" : "x", "image" : "http:/x.com/y.jpg"
}

I can edit the results after aggregate in a loop. but can aggregate give this to me as I want?

1 Answers
Related