I am trying to search results (that I get back from a SOAP API call) which are what I believe to be a Javascript object array since it doesn't follow JSON standards.
Here is a sample of the data:
[ { '$': { uuid: '{461F892D-07D8-4FCA-AF86-D5A9CBB080B8}' },
pattern: [ '*689XXXX' ],
description: [ 'DHHS_62' ],
routePartitionName: [ 'DHHS_62-PT' ] },
{ '$': { uuid: '{84651C57-5E4C-4981-B859-38C8ECC56E3B}' },
pattern: [ '*745XXXX' ],
description: [ 'DHHS_43' ],
routePartitionName: [ 'DHHS_43-PT' ] },
{ '$': { uuid: '{BC3259C4-38DB-4AD6-8594-61B938E4542C}' },
pattern: [ '*753XXXX' ],
description: [ 'DEQ_50' ],
routePartitionName: [ 'DEQ_50-PT' ] },
{ '$': { uuid: '{4CF32D54-BED2-4167-A5E8-E0206520218A}' },
pattern: [ '*7XXXXXXX' ],
description: [ 'DNR_21' ],
routePartitionName: [ 'DNR_21-PT' ] } ]
I have tried to use NPM modules array-query and json-query and neither work. I believe I am either doing something wrong to query the data, or I have dirty data that needs to be cleaned up.
Can anyone verify:
- Is the data a JS array or dirty?
- A query that uses the logic. (If "routePartitionName" = "DHHS_62-PT" then return "pattern"?
I think I'm way off in the weeds on this, and can't seem to find my way back to the road. I appreciate any help or advice!