I am working in Go
and MongoDB
and having the following MongoDB schema
[
{
"name":"sample",
"time": "2014-04-05",
"Qty":3
},
{
"name":"sample",
"time": "2014-04-05",
"Qty":3
}
]
I had tried using the following code to create the above document
elements := make([3]map[string]string)
elements["name"] = "karthick"
elements["date"] = "2014-04-05"
elements["qty"] = 3
fmt.Println(elements)
But it is not working.
Error : cannot make type [3]map[string]string
Any suggestion will be grateful