0

I'm trying to remove some embedded documents from history. I'm using mongodb 3.2 There are two conditions:

  1. "name" must be for example sa
  2. "history" "start" must be greater some date
{
    "name" : "sa",
    "history" : [ 
        {
            "start" : ISODate("2015-11-11T12:46:32.000Z"),
            "value" : "color1"
        }, 
        {
            "start" : ISODate("2015-11-12T11:54:20.000Z"),
            "value" : "color2"
    }]
}
{
    "name" : "sa",
    "history" : [ 
        {
            "start" : ISODate("2015-11-11T12:46:32.000Z"),
            "value" : "color1"
        }, 
        ]
            "start" : ISODate("2015-11-12T11:54:20.000Z"),
            "value" : "color2"
    }] 
}
{
    "name" : "so",
    "history" : [ 
        {
            "start" : ISODate("2015-11-11T12:46:32.000Z"),
            "value" : "color1"
        }, 
        {
            "start" : ISODate("2015-11-12T11:54:20.000Z"),
            "value" : "color2"
    }] 
}
K_H
  • 29
  • 1
  • 5

1 Answers1

0

I couldn't do it directly. I download the collection and then do the operations that I need, remove the old collection and then insert the new collection with the data that I need.

K_H
  • 29
  • 1
  • 5