имеют такую коллекцию
[
{
_id: ObjectId("5ab9cbe531c2ab715d42129a"),
p_id: ObjectId("507f191e810c19729de860ea"),
name: "elmaro",
mobile: 112466,
area: "texas",
mapped: [
{
_id: ObjectId("5e13642ee88247a6b4f2c0f9"),
p_id: ObjectId("507f191e810c19729de860eb"),
effected: "12",
tested: "14255",
negative: "1658451"
},
{
_id: ObjectId("5e13642ee88247a6b4f2c0f1"),
p_id: ObjectId("507f191e810c19729de860ea"),
effected: "254",
tested: "54851",
negative: "158521541"
}
]
},
{
_id: ObjectId("5ab9cbe531c2ab715d52128a"),
p_id: ObjectId("507f191e810c19729de860ea"),
name: "hukke",
mobile: 112466,
area: "texas",
mapped: [
{
_id: ObjectId("5e13642ee88247a6b4f2c0f9"),
p_id: ObjectId("507f191e810c19729de860ea"),
effected: "1222",
tested: "3545621",
negative: "354168512"
}
]
}
]
Она должна быть сопоставлена с p_id
. и непревзойденный массив должен быть удален следующим образом.
[
{
_id: ObjectId("5ab9cbe531c2ab715d42129a"),
p_id: ObjectId("507f191e810c19729de860ea"),
name: "elmaro",
mobile: 112466,
area: "texas",
mapped: [
{
_id: ObjectId("5e13642ee88247a6b4f2c0f1"),
p_id: ObjectId("507f191e810c19729de860ea"),
effected: "254",
tested: "54851",
negative: "158521541"
}
]
},
{
_id: ObjectId("5ab9cbe531c2ab715d52128a"),
p_id: ObjectId("507f191e810c19729de860ea"),
name: "hukke",
mobile: 112466,
area: "texas",
mapped: [
{
_id: ObjectId("5e13642ee88247a6b4f2c0f9"),
p_id: ObjectId("507f191e810c19729de860ea"),
effected: "1222",
tested: "3545621",
negative: "354168512"
}
]
}
]
Пн go версия: 4.0.14