Skip to content

Commit 24d242d

Browse files
authored
fix: use createIndex instead of deprecated ensureIndex in index playground template (#205)
1 parent 561fca1 commit 24d242d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/templates/playgroundCreateIndexTemplate.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ const template = `// MongoDB Playground
55
use('CURRENT_DATABASE');
66
77
// Create a new index in the collection.
8-
// 'ensureIndex' checks to see if the index already exists
9-
// before creating it, to avoid duplicates.
108
db.getCollection('CURRENT_COLLECTION')
11-
.ensureIndex(
9+
.createIndex(
1210
{
1311
/*
1412
* Keys

0 commit comments

Comments
 (0)