What exactly happens when I call ensureIndex(data) when typical data looks like data:{name: \"A\",age:\"B\", job : \"C\"} ? Will it create a compou
ensureIndex(data)
data:{name: \"A\",age:\"B\", job : \"C\"}
you can try this :
db.collection.ensureIndex({"data.name": 1,"data.age":1, "data.job" : 1})