Skip to content

Combining Two objects based on common id #275

@seaverd

Description

@seaverd

How would I create a single json object that combines the paths.vehicle and paths.location objects below. Both of these objects contain a common key:value pair of vehicleId Sample anonymized data is included below.

Thanks for any assistance you can provide!
Dan

/<{
"_msgid": "9f42605f.66dc4",
"topic": "",
"payload": [
]
"paths": {
"vehicle": [
{
"vehicleId": 942297,
"label": "E M660",
"vin": "1VINNOWBLANK",
"serial": "333333333",
"make": "CHEVROLET",
"model": "TAHOE",
"year": 2012,
"ymm": "2012 CHEVROLET TAHOE",
"license": "XJXXXX"
},
{
"vehicleId": 763803,
"label": "LW04",
"vin": "2VINNOWBLANK",
"serial": "222222222",
"make": "FORD",
"model": "F-150",
"year": 2017,
"ymm": "2017 FORD F-150",
"license": "XBXXXX"
},
{
"vehicleId": 763800,
"label": "LWB1",
"vin": "3VINNOWBLANK",
"serial": "111111111",
"make": "CAT",
"model": "BACKHOE",
"year": 2010,
"ymm": "2010 CAT BACKHOE",
"license": "AXXXXX"
},
],
"location": [
{
"vehicleId": 763800,
"messageTime": "2018-11-09T14:43:19Z",
"latitude": 39.745244,
"longitude": -69.792142
},
{
"vehicleId": 763803,
"messageTime": "2018-11-08T18:56:26Z",
"latitude": 39.745316,
"longitude": -69.792071
},
{
"vehicleId": 942297,
"messageTime": "2017-07-28T14:30:00Z",
"latitude": 39.746169,
"longitude": -69.792427
},
]
}
}
/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions