Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
一度に複数のテーブルのインデックスを作成しようとしています。私は現在、この効果を作成するためにforループを使用していますが、明らかに私のforループは機能しません。
for(i=3;i<8;i++) { db.events_i.ensureIndex({userid:1, numid:1}); };
どうすればこれを修正できますか?:)
これを試して
for(var i = 3; i < 8; i++) { db.getCollection('events_' + i).ensureIndex({userid: 1, numid: 1}); };