Is there anything that is built into the magic record to handle orphans? For example, if I load the following JSON data ...
[
{ "_id" : "b1", "name" : "brandA"},
{ "_id" : "b2", "name" : "brandB"},
{ "_id" : "b3", "name" : "brandC"}
]
Then the data is updated and brandCdeleted.
[
{ "_id" : "b1", "name" : "brandA"},
{ "_id" : "b2", "name" : "brandB"}
]
More importantly, how to remove orphaned nested objects like productBbelow
[
{ "_id" : "b1",
"name" : "brandA"
"products" : [
{"_id" : "p1", "name" : "productA" },
{"_id" : "p2", "name" : "productB" }
]
},
{ "_id" : "b2",
"name" : "brandB"
"products" : [
{"_id" : "p3", "name" : "productC" },
{"_id" : "p4", "name" : "productD" }
]
}
]
glued source
share