File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -4867,16 +4867,29 @@ var all_tests = {
48674867 } ,
48684868
48694869 save_error_on_save_test : function ( ) {
4870- client . collection ( "testing" , function ( err , collection ) {
4870+ client . collection ( "save_error_on_save_test" , function ( err , collection ) {
4871+ //insert new user
4872+ collection . save ( {
4873+ email : 'email@email.com' ,
4874+ encrypted_password : 'password' ,
4875+ friends :
4876+ [ '4db96b973d01205364000006' ,
4877+ '4db94a1948a683a176000001' ,
4878+ '4dc77b24c5ba38be14000002' ] ,
4879+ location : [ 72.4930088 , 23.0431957 ] ,
4880+ name : 'Amit Kumar' ,
4881+ password_salt : 'salty' ,
4882+ profile_fields : [ ] ,
4883+ username : 'amit' } , function ( err , doc ) {
4884+ } ) ;
4885+
48714886collection . find ( { } ) . limit ( 1 ) . toArray ( function ( err , users ) {
4872- debug ( "================ hello" )
4873-
48744887user = users [ 0 ]
48754888if ( err ) {
48764889console . log ( err . message )
48774890} else if ( user ) {
48784891user . friends . splice ( 1 , 1 )
4879- collection . save ( user , function ( err , doc ) {
4892+ collection . save ( user , { safe : true } , function ( err , doc ) {
48804893if ( err ) {
48814894console . log ( err . message )
48824895}
You can’t perform that action at this time.
0 commit comments