Am trying to get values from a json data using node.js
Following is the json data(It is dynamic), it may contains names like tcp,ipp,http,udp,https .here i only displaying tcp and ipp only
sample json
[ { '$':
{ name: 'tcp',
showname: 'tnternet crinting Protocol',
size: '584',
pos: '202' },
field: [ [Object], [Object], [Object], [Object] ] },
{ '$':
{ name: 'ipp',
showname: 'Internet Printing Protocol',
size: '584',
pos: '202' },
field: [ [Object], [Object], [Object], [Object], [Object], [Object] ] } ]
i need to get the details of ipp only .
(any other methods without using sample[1] ,like name =ipp from the json data)
example
{ '$':
{ name: 'ipp',
showname: 'Internet Printing Protocol',
size: '584',
pos: '202' },
field:
[ { '$': [Object] },
{ '$': [Object] },
{ '$': [Object] },
{ '$': [Object], field: [Object] },
{ '$': [Object], field: [Object] },
{ '$': [Object] } ] }