I am very new to mongodb and golang. I have a collection named "myplace" inside that, one field named region which is an array of values how we can retrieve the whole array.
my collection look likes
{
"_id" : ObjectId("5474227309d76eb732acd134"),
"City" : "some city",
"region" : [
{
"regionid" : "31",
"historical_place" : "temple"
},
{
"regionid" : "32",
"historical_place" : "temple"
},
{
"regionid" : "33",
"historical_place" : "temple"
}
]
}
Expecting output
[
{
"City": "Some CIty",
"region":[
{
"regionid" : "31",
"historical_place" : "temple"
},
{
"regionid" : "32",
"historical_place" : "temple"
},
{
"regionid" : "33",
"historical_place" : "temple"
}
]
}
]
Any solution?