I have an array of arrays in MongoDB 4.2.2:
db.foo.insertOne({'foo': [[1, 3], [2], [3]]})
I'd like to remove elements of foo, first elements of which are greater than 1. But I cannot figure out how.
I tried something like this (and many more) but it does not pull anything:
db.foo.update({}, {$pull: {foo: {'0': {$gt: 1}}}})
Is it possible?
EDIT: Expected result:
db.foo.find({})
{ "_id": ObjectId("..."), "foo": [ [1, 3] ] }
[1,3]greater than 1? If yes, what are the exact conditions for that?[1, 3]does not hold the condition.