Hello! I have migrated from an SQL server over to Mongodb. Could somebody help me how to do this? I simply want to update the deals collection by adding a new store field on all of the the deals to reference the store id. But I only got the old id from the previous system. (So it’s many stores and many many deals)
stores collection:
{
_id: ObjectId("63b99eb127647f05bffaaa13"),
oldId: 425,
name": "Ikea"
}
deals collection:
{
_id: ObjectId("63b9de7ab898047ba0e5c876"),
title: "Red chairs",
oldStoreId: 425
}
expected result on deals collection:
{
_id: ObjectId("63b9de7ab898047ba0e5c876"),
title: "Red chairs",
oldStoreId: 425,
store: ObjectId("63b99eb127647f05bffaaa13")
}