@@ -871,3 +871,41 @@ exports['should correctly execute updateOne operations with w:0 and upsert'] = {
871
871
} ) ;
872
872
}
873
873
}
874
+
875
+ exports [ 'should correctly execute crud operations using w:0' ] = {
876
+ // Add a tag that our runner can trigger on
877
+ // in this case we are setting that node needs to be higher than 0.10.X to run
878
+ metadata : { requires : { topology : [ 'single' , 'replicaset' , 'sharded' , 'ssl' , 'heap' , 'wiredtiger' ] } } ,
879
+
880
+ // The actual test we wish to run
881
+ test : function ( configuration , test ) {
882
+ var db = configuration . newDbInstance ( configuration . writeConcernMax ( ) , { poolSize :1 , auto_reconnect :false } ) ;
883
+ // Establish connection to db
884
+ db . open ( function ( err , db ) {
885
+ test . equal ( null , err ) ;
886
+
887
+ var collection = db . collection ( 'w0crudoperations' ) ;
888
+ collection . insertOne ( { } , function ( err , r ) {
889
+ console . log ( "-------------------------------------------" )
890
+ console . dir ( err )
891
+ console . dir ( r )
892
+
893
+ db . close ( ) ;
894
+ test . done ( ) ;
895
+ } ) ;
896
+
897
+ // collection.insertOne({a:1});
898
+ // collection.insertMany([{b:1}]);
899
+ // collection.updateOne({c:1}, {$set:{a:1}}, {upsert:true});
900
+
901
+
902
+ // db.collection('try').updateOne({_id:1}, {$set:{x:1}}, {upsert:true, w:0}, function(err, r) {
903
+ // test.equal(null, err);
904
+ // test.ok(r != null);
905
+
906
+ // db.close();
907
+ // test.done();
908
+ // });
909
+ } ) ;
910
+ }
911
+ }
0 commit comments