There is ia part of the document of the collection Collection1 in MongoDb.
"array1": [
"060030909",
"200",
"32004"
],
"array2": [
"aaa",
"bbb",
"xxx"
]
It is necessary to find all documents in collection "Collection1" where the array array1[] contains the element "32004", remove it, and also remove the corresponding element in the array2[] array by the index matching the one of the removed element in array1[].
The result must be:
"array1": [
"060030909",
"200"
],
"array2": [
"aaa",
"bbb"
]
in all documents of the collection.
How can it be done first of all using MongoTemplate? Thanks