so i've got a collection like so
_id: "a6c67aad-e90c-4a13-aae0-74e5ca5c8632"
value : true
and one like this
_id: "a6c67aad-e90c-4a13-aae0-74e5ca5c8632"
otherValue : false
How can i use aggregation pipelines to update the second collection otherValue with the value from the first collection based on _id
I've tried using lookup and then unwind like
{
from: 'col1',
localField: 'otherValue',
foreignField: 'value',
as: 'data'
}
and then unwind
{
path: '$val'
}
But im not quite sure where to go from here, any help would be greatly appreciated.