Subdocument index in mongo

后端 未结 2 501

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

2条回答
  •  半阙折子戏
    2020-12-14 06:46

    you can try this :

    db.collection.ensureIndex({"data.name": 1,"data.age":1, "data.job" : 1})
    

提交回复
热议问题