Hi,
Using some testing collection i've put MongoDB (using MongoCollectionInsert[]) I've been exploring the MongoLink function MongoCollectionUpdateMany by using the equivalent sintaxe from MongoDB for create/update (
$set), for increment ($inc), etc for field and arrays but one problem has come when the field (or sub-fields) are arrays:
The MongoCollectionUpdateMany[collection, filter, update] has 3 parameters and the equivalent (i assume) on MongodDB is db.collection.updateMany(filter, update, arraysFilters), although appears to also have 3 parameters in reality it has 4 because you define the coolection "outside" the brackets.....and so it became a problem because that arraysFilters has no place on the MongoLink function.
db.students.insert([
{ "_id" : 1, "grades" : [ 95, 92, 90 ] },
{ "_id" : 2, "grades" : [ 98, 100, 102 ] },
{ "_id" : 3, "grades" : [ 95, 110, 100 ] }
])
db.students.updateMany(
{ grades: {
$gte: 100 } },
{ $set: { "grades.$[element]" : 100 } },
{ arrayFilters: [ { "element": { $gte: 100 } } ] }
)
(because grades is a array its no enought to filter it (first parameter), you have to filter by element of the arrays ans the MongoLink don't have this forth parameter)
I may give you some examples but i was hopping that someone has dealt with this issue and give me some help.