Hi,
I have specific structure with array of arrays
{
…
runs:[
[2,{"$date": “2020-01-01T10:12:12.000Z”}, …],
[55, {"$date": “2020-03-01T10:12:12.000Z”}, …] ,
…]
}
the array of “runs” contains log of procedures that where executed once and I want to delete old ones.
i.e. I need to remove all sub arrays with date less than X on 2nd place of array.
My single suggestion for this
db.myCollection.update( {}, {$pull: {runs: {1:{$lte:{$date: “2020-01-15T20:12:12.000Z”}} } } } )
should change above to something like
{
…
runs:[
[55, {"$date": “2020-03-01T10:12:12.000Z”}, …] ,
…]
}
but didn’t work
I currently using version 4.4.1 of mongodb
I am new for mongodb than I sure do not see something important.
any other suggestions for this case?
Thanks