i have two diffrent object on my json file and i want to connect between them with the attribute of systemName.
how to do so?
this is how the event object look like:
and i want to get the systemName from the Systems object the contain all the systems name List.
{
"_id" : ObjectId("5ad8764465639315a4e54e39"),
"yellowEvents" : 1,
"redEvents" : 1,
"commands" : "test",
"systemName" : "armyEG",
"__v" : 0
}
this is how the System object look like :
{
"_id" : ObjectId("5ad86abc6837621e309671a3"),
"systemName" : "armyTS",
"__v" : 0
},
{
"_id" : ObjectId("5ad86abc6837621e309671a3"),
"systemName" : "armyIL",
"__v" : 0
},
{
"_id" : ObjectId("5ad86abc6837621e309671a3"),
"systemName" : "armyEG",
"__v" : 0
},
{
"_id" : ObjectId("5ad86abc6837621e309671a3"),
"systemName" : "armyRU",
"__v" : 0
}
What I have tried:
i have tried to do like this:
{
"_id" : ObjectId("5ad8764465639315a4e54e39"),
"yellowEvents" : 1,
"redEvents" : 1,
"commands" : "test",
"systemName" : "System[2].systemName",
"__v" : 0
}