mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
--stopOnError option to mongoimport SERVER-1133
This commit is contained in:
parent
a923513e69
commit
a0ce62f1ea
@ -142,6 +142,7 @@ public:
|
||||
("drop", "drop collection first " )
|
||||
("headerline","CSV,TSV only - use first line as headers")
|
||||
("upsert", "insert or update objects that already exist" )
|
||||
("stopOnError", "stop importing at first error rather than continuing" )
|
||||
;
|
||||
addPositionArg( "file" , 1 );
|
||||
_type = JSON;
|
||||
@ -260,6 +261,9 @@ public:
|
||||
cout << "exception:" << e.what() << endl;
|
||||
cout << buf << endl;
|
||||
errors++;
|
||||
|
||||
if (hasParam("stopOnError"))
|
||||
break;
|
||||
}
|
||||
|
||||
num++;
|
||||
|
Loading…
Reference in New Issue
Block a user