First of all, I found so many solutions for python and mongo shell, but nothing for C#, this is why I create this thread.
The database has a list of projects, the project has a list of files and the list of files has a list of translations. The task is to delete a translation document with a given ID from the translation array. We know every information to find the document like _id of the project, _id of the file and the ID of the translation.
Here is how it looks:
[{
"_id": "62e237a1d866d82c881629a1",
"Name": "test92",
"PrimarySourceLanguage": "eng",
"PivotSourceLanguage": "hun",
"TargetLanguages": [
"prs",
"fre-BE",
"fre-CH"
],
"Files": [
{
"segments": [
],
"Name": "smallBatch_test.json",
"_id": "f7b02afb-ec62-439b-be6d-403b8f1434ff",
"ImportDate": {
"$date": {
"$numberLong": "1658992556090"
}
},
"TargetLanguages": null,
"Translation": [
{
"ID": "e5e09f84-64d7-40a4-87f7-a90f5a956c32",
"SourceLanguage": "eng",
"TargetLanguage": "prs",
"TranslatedString": null,
"ProjectGuid": "62e237a1d866d82c881629a1",
"FileGuid": "f7b02afb-ec62-439b-be6d-403b8f1434ff",
"Status": "Translation deleted"
},
{
"ID": "8d4ca52c-0063-474a-94db-fd2d8b1f2cee",
"SourceLanguage": "eng",
"TargetLanguage": "prs",
"TranslatedString": "Boci múú",
"ProjectGuid": "62e237a1d866d82c881629a1",
"FileGuid": "f7b02afb-ec62-439b-be6d-403b8f1434ff",
"Status": null
},
{
"ID": "2929dc9e-5254-4093-93bc-fbcdcb265ea7",
"SourceLanguage": "eng",
"TargetLanguage": "prs",
"TranslatedString": "Bocikaaa",
"ProjectGuid": "62e237a1d866d82c881629a1",
"FileGuid": "f7b02afb-ec62-439b-be6d-403b8f1434ff",
"Status": "Translated"
}
]
}
],
"TemplateGuid": {
"$binary": {
"base64": "AAAAAAAAAAAAAAAAAAAAAA==",
"subType": "03"
}
},
"Deadline": {
"$date": {
"$numberLong": "1659165300000"
}
},
"TMs": [
null
],
"TBs": [
null
],
"Domain": null,
"Client": null
}]
I tried to use pullfilter or using update with Pull command, but none of them worked :(