@@ -174,7 +174,7 @@ exports.shouldCorrectlyExecuteLastStatus = function(test) {
174
174
exports . shouldFailInsertDueToUniqueIndex = function ( test ) {
175
175
client . createCollection ( 'test_failing_insert_due_to_unique_index' , function ( err , r ) {
176
176
client . collection ( 'test_failing_insert_due_to_unique_index' , function ( err , collection ) {
177
- collection . ensureIndex ( [ [ 'a' , 1 ] ] , true , function ( err , indexName ) {
177
+ collection . ensureIndex ( [ [ 'a' , 1 ] ] , { unique : true , safe : true } , function ( err , indexName ) {
178
178
collection . insert ( { a :2 } , { safe : true } , function ( err , r ) {
179
179
test . ok ( err == null ) ;
180
180
collection . insert ( { a :2 } , { safe : true } , function ( err , r ) {
@@ -194,7 +194,7 @@ exports.shouldFailInsertDueToUniqueIndexStrict = function(test) {
194
194
error_client . dropCollection ( 'test_failing_insert_due_to_unique_index_strict' , function ( err , r ) {
195
195
error_client . createCollection ( 'test_failing_insert_due_to_unique_index_strict' , function ( err , r ) {
196
196
error_client . collection ( 'test_failing_insert_due_to_unique_index_strict' , function ( err , collection ) {
197
- collection . ensureIndex ( [ [ 'a' , 1 ] ] , true , function ( err , indexName ) {
197
+ collection . ensureIndex ( [ [ 'a' , 1 ] ] , { unique : true , safe : true } , function ( err , indexName ) {
198
198
collection . insert ( { a :2 } , { safe :true } , function ( err , r ) {
199
199
test . ok ( err == null ) ;
200
200
collection . insert ( { a :2 } , { safe :true } , function ( err , r ) {
@@ -262,7 +262,7 @@ exports.shouldHandleAssertionError = function(test) {
262
262
collection . findOne ( query , function ( err , docs ) {
263
263
test . ok ( err instanceof Error ) ;
264
264
265
- collection . ensureIndex ( [ [ 'a' , '2d' ] ] , true , function ( err , indexName ) {
265
+ collection . ensureIndex ( [ [ 'a' , '2d' ] ] , { unique : true , safe : true } , function ( err , indexName ) {
266
266
test . ok ( err == null ) ;
267
267
268
268
collection . findOne ( query , function ( err , doc ) {
0 commit comments