-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Tools
-
None
-
ALL
I'm finding that mongoimport is claiming 0 documents imported when the number is higher. This happens for me in a use case when there are duplicate key errors, but the mongoimport is still able to proceed.
This can lead to confusion in circumstances when users aren't checking directly to see the results of the mongoimport. This is the case for students in our current m101 courses, because they have a homework problem that requires them to mongoimport data.
Steps to reproduce:
- First, use the attached zips.json file, then perform a mongoimport with
mongoimport -d test -c zips --drop zips.json
(old_sand)~/Downloads % mongo MongoDB shell version: 3.0.2 connecting to: test > db.zips.count() 29467 > db.zips.drop() true > db.zips.count() 0 > bye (old_sand)~/Downloads % mongoimport -d test -c zips --drop zips.json 2015-04-16T15:21:47.844-0400 connected to: localhost 2015-04-16T15:21:47.844-0400 dropping: test.zips 2015-04-16T15:21:47.967-0400 error inserting documents: E11000 duplicate key error index: test.zips.$_id_ dup key: { : "32350" } 2015-04-16T15:21:48.097-0400 error inserting documents: E11000 duplicate key error index: test.zips.$_id_ dup key: { : "63673" } 2015-04-16T15:21:48.228-0400 error inserting documents: E11000 duplicate key error index: test.zips.$_id_ dup key: { : "42223" } 2015-04-16T15:21:48.228-0400 imported 0 documents (old_sand)~/Downloads % mongo MongoDB shell version: 3.0.2 connecting to: test > db.zips.count() 29467 >
- duplicates
-
TOOLS-349 mongoimport may report incorrect number of imported documents
- Closed