[SERVER-18089] Mongoimport claims it imported 0 documents when it successfully imports. Created: 16/Apr/15  Updated: 23/Apr/15  Resolved: 23/Apr/15

Status: Closed
Project: Core Server
Component/s: Tools
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: William Cross Assignee: Ramon Fernandez Marina
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File zips.json    
Issue Links:
Duplicate
duplicates TOOLS-349 mongoimport may report incorrect numb... Closed
Operating System: ALL
Participants:

 Description   

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
>



 Comments   
Comment by William Cross [ 16/Apr/15 ]

ramon.fernandez, confirmed, this looks like a dup to me, as well.

Comment by Ramon Fernandez Marina [ 16/Apr/15 ]

William, can you please confirm that mongoimport is also version 3.0.x? This may be a dup of TOOLS-349.

Generated at Thu Feb 08 03:46:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.