...
I am trying to create a query that updates arrayed subdocuments, but I keep getting an error: "No array filter found for identifier '' in path ''" Error is getting in Robo 3T 1.2.1. When execute update from shell in terminal everything is ok. It is reproducible using the examples from the documentation. mongo --version MongoDB shell version v3.6.9 git version: 167861a164723168adfaaa866f310cb94010428f OpenSSL version: OpenSSL 1.0.2n 7 Dec 2017 allocator: tcmalloc modules: none build environment: distmod: ubuntu1604 distarch: x86_64 target_arch: x86_64
daniel.hatcher commented on Fri, 16 Nov 2018 15:47:56 +0000: Hello Denis, You mention that the shell performs as expected, can you please confirm? Unfortunately, Robo3T is not a MongoDB product so we are unable to help with bugs within it. I recommend that you reach out to the people that develop the tool at robomongo as they would be best to help you. Thank you, Danny
Create collection db.students2.insertMany([{ "_id" : 1, "grades" : [ { "grade" : 80, "mean" : 75, "std" : 6 }, { "grade" : 85, "mean" : 90, "std" : 4 }, { "grade" : 85, "mean" : 85, "std" : 6 } ] }, { "_id" : 2, "grades" : [ { "grade" : 90, "mean" : 75, "std" : 6 }, { "grade" : 87, "mean" : 90, "std" : 3 }, { "grade" : 85, "mean" : 85, "std" : 4 } ] }]) Execute query for Robo 3T db.students2.update( { }, { $set: { "grades.$[elem].mean" : 100 } }, { multi: true, arrayFilters: [ { "elem.grade": { $gte: 85 } } ] } ) Result No array filter found for identifier 'elem' in path 'grades.$[elem].mean' Save same query to file students2.js and execute in terminal shell mongo test students2.js Result MongoDB shell version v3.6.9 connecting to: mongodb://127.0.0.1:27017/test Implicit session: session { "id" : UUID("ca4a94a6-75ce-45d0-a3d8-38c5b2a4aaa4") } and only after shell executing db.getCollection('students2').find({}) gives /* 1 */ { "_id" : 1.0, "grades" : [ { "grade" : 80.0, "mean" : 75.0, "std" : 6.0 }, { "grade" : 85.0, "mean" : 100.0, "std" : 4.0 }, { "grade" : 85.0, "mean" : 100.0, "std" : 6.0 } ] } /* 2 */ { "_id" : 2.0, "grades" : [ { "grade" : 90.0, "mean" : 100.0, "std" : 6.0 }, { "grade" : 87.0, "mean" : 100.0, "std" : 3.0 }, { "grade" : 85.0, "mean" : 100.0, "std" : 4.0 } ] }