In MongoDB,
I know how to insert objects, such as:
db.animals.insert(
{"name": "cat"},
{"name" : "dog"},
{"name" : "zebra"}
)
But how do I insert an array instead? So I don't have to define a key/value pair? Such as:
db.animals.insert([
"cat",
"dog",
"zebra"
])
This last one doesn't work.
The reason why I want to insert an array, is that I want to get the following data when I do a db.animals.find({})
"cat", "dog", "zebra"