Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-463

bsondump prints "0 objects found" when given invalid options

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.8.0-rc3
    • Affects Version/s: 2.8.0-rc2
    • Component/s: bsondump
    • None
    • Not Needed

      bsondump prints "0 objects found" in cases where it shouldn't be getting to the point where it can try to read objects.

      For instance, when given an invalid --type:

      2014-12-05T13:31:34.783-0500 shell: started program bsondump --type=fake jstests/bsondump/testdata/sample.bson
      sh24515| 2014-12-05T13:31:34.789-0500	0 objects found
      sh24515| 2014-12-05T13:31:34.789-0500	Unsupported output type 'fake'. Must be either 'debug' or 'json'
      

      Or a non-existent file:

      2014-12-05T13:32:13.080-0500	0 objects found
      2014-12-05T13:32:13.080-0500	Couldn't open BSON file: open adsf: no such file or directory
      

      Ideally, we wouldnt print object counts unless we were able to read and attempt to parse a file. The only case that generates "0 objects found" should be when the tool is given an empty .bson file

            Assignee:
            Unassigned Unassigned
            Reporter:
            kyle.erf Kyle Erf
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: