Node Driver - How to updateMany Replace Array with last item in Array

Then this course was especially designed for you! And it’s free :tada: !

I don’t even know how to reuse the value of an existing field in the document without the aggregation framework. Maybe there is a way but the aggregation framework is really like super powers!

Using MongoDB without the aggregation framework is like using a motorbike without putting gas in it. :smiley: ! You will eventually be able to get to your destination but this is going to require a lot more effort and it won’t be efficient :slight_smile:.

I did some research before sending this answer and there is a way to do this with an “update” operation. But you will also need the aggregation pipeline which can now be used in the update operations… :muscle:. So it’s aggregation or aggregation basically.

Cheers,
Maxime.

2 Likes