hi, currently am able to get the vlaues but will like to get both key and values, how will i be able to do it. This is output i got now, a slice of the apiVersionInUri", which is corent but want it with the keys, like "apiVersionInUri": "http://instance4.com"", map form [ "http://instance4.com", "http://instance4.com", "http://instance4.com", "http://instance4.com", "http://instance4.com", "http://instance4.com", "http://instance4.com", "http://instance4.com", "http://instance4.com", "http://instance4.com", "http://instance4.com", "http://instance4.com", "http://instance4.com/home", "http://instance4.com", "http://instance4.com", "http://instance4.com", "http://instance4.com", "http://instance4.com", "http://instance4.com", "http://instance4.com", "http://localhost.com.test" ]
On Thursday, February 14, 2019 at 2:33:43 PM UTC+2, afriyie...@gmail.com wrote: > > Hi, > > Am quite new in go language and asking for help. > I have this JSON object in mongodb with collection name "COLLECTION", > I have multiple object in the database (mongo) and would like to access > all the string > values """apiVersionInUri": "string", in all the objects. > Can anyone help me do this in Golang. I know i will need a for loop to > achieve this but > i dont know how to go about it. > > Thanks in advance > > //Example JSON object look like this > > > { > "nfInstanceId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", > "heartBeatTimer": 0, > "sNssais": [ > { > "sst": 0, > "sd": "string" > } > ], > "nsiList": [ > "string" > ], > "nfServices": [ > { > "serviceInstanceId": "string", > "versions": [ > { > "apiVersionInUri": "string", > "apiFullVersion": "string", > "expiry": "2019-02-03T12:08:56.650Z" > } > ] > } > ] > } > > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.