Hi,
I lack the knowledge of pulling an specific object from an array and hope someone could help me out.
The relevant part of my collection document looks like this:
"mo": [
{
"name": "Name1",
"day": "Day2",
"server": "Server1",
"eventTime": "20:00",
"rank": 0,
"location": "Location1",
"owner": "111222"
},
{
"name": "Name2",
"day": "Day2",
"server": "Server2",
"eventTime": "20:00",
"rank": 0,
"location": "Location2",
"owner": "222333"
}
So if I would like to pull the object with the name “Name2” how exactly could I target it? I can do it with String-arrays just fine by naming the array-element like so:
ChatMeta.update({character: charOwner}, {
$pull: {
lastWhisp: char,
},
},
);
But I don’t quite get how to name a specific object in a similar manner.
Thanks for any help!