-
Type: New Feature
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: mongoimport
-
None
-
1,654
-
(copied to CRM)
Hi,
I have a customer who is looking for a way when using the mongoimport command to get a read out of the number of updated records vs inserted records.
We tried to increase the verbosity with the -vvv options, but it just spits out the record from a csv that got loaded. And it doesn't appear to change from when the record exists in the collection or doesn't exist and is updated.
Fwiw, we did a quick test on 4.2.3 with 2 documents: one inserted and one upserted and they were both reported in the same bucket:
$ mongoimport --file=exported.json --db=test --collection=a2 --mode=upsert 2020-05-12T12:46:27.057+1000 connected to: mongodb://localhost/ 2020-05-12T12:46:27.058+1000 2 document(s) imported successfully. 0 document(s) failed to import. $
Based on our documentation and our testings, it looks like we don't have any functionality to have it break it down into more detailed information at the moment. Basically, reporting upsert counts is not currently done by mongoimport.
I've checked it with one of the local core Engineers and it seems that , in theory, the update command should report nMatched, nUpserted and nModified so this seems reasonable to ask. Therefore, could you please look into this feature request? Thank you.