Skip to content

Commit 4da8333

Browse files
committed
NODE-527 The API example for collection.createIndex shows Db.createIndex functionality.
1 parent 85c8b96 commit 4da8333

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

HISTORY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* NODE-506 Ensures that errors from bulk unordered and ordered are instanceof Error (Issue #1282, https://github.com/owenallenaz).
77
* NODE-526 Unique index not throwing duplicate key error.
88
* NODE-528 Ignore undefined fields in Collection.find().
9+
* NODE-527 The API example for collection.createIndex shows Db.createIndex functionality.
910

1011
2.0.39 07-14-2015
1112
-----------------

test/functional/operation_example_tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ exports.shouldCreateComplexIndexOnTwoFields = {
529529
test.equal(null, err);
530530

531531
// Create an index on the a field
532-
db.createIndex('createIndexExample1', {a:1, b:1}
532+
collection.createIndex({a:1, b:1}
533533
, {unique:true, background:true, w:1}, function(err, indexName) {
534534

535535
// Show that duplicate records got dropped

test/functional/operation_generators_example_tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ exports.shouldCreateComplexIndexOnTwoFieldsWithGenerators = {
217217
, {a:2, b:2}, {a:3, b:3}, {a:4, b:4}], configuration.writeConcernMax());
218218

219219
// Create an index on the a field
220-
yield db.createIndex('createIndexExample1_with_generators', {a:1, b:1}
220+
yield collection.createIndex({a:1, b:1}
221221
, {unique:true, background:true, w:1});
222222

223223
// Show that duplicate records got dropped

test/functional/operation_promises_example_tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ exports.shouldCreateComplexIndexOnTwoFieldsWithPromises = {
200200
, {a:2, b:2}, {a:3, b:3}, {a:4, b:4}], configuration.writeConcernMax()).then(function(result) {
201201

202202
// Create an index on the a field
203-
db.createIndex('createIndexExample1_with_promise', {a:1, b:1}
203+
collection.createIndex({a:1, b:1}
204204
, {unique:true, background:true, w:1}).then(function(indexName) {
205205

206206
// Show that duplicate records got dropped

0 commit comments

Comments
 (0)