how can I get an object of array by index
example:
{ "_id" : 1, "name" : "bob", colors: [ "red", "blue", "green"] }
{ "_id" : 2, "name" : "jim", colors: ["yellow", "black" ] }
my query: something like
db.users.find({name: "bob"}, {colors: 2})
result:
{ "_id" : 1, "name" : "bob", colors: "blue" }