在MongoDB中,以下哪项是创建索引的正确调用方式?( )
db.somecollection.createIndex({key:1});
db.somecollection.ensureIndex({key:1});
db.somecollection.ensureIndex();
db.somecollection.ensureIndex({key:1}, { expireAfterSeconds: 3600 });
在MongoDB中,以下哪项是创建索引的正确调用方式?( )
db.somecollection.createIndex({key:1});
db.somecollection.ensureIndex({key:1});
db.somecollection.ensureIndex();
db.somecollection.ensureIndex({key:1}, { expireAfterSeconds: 3600 });