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

depending on the output format, mongoexport displays different behaviors for --fields and --fieldFile options

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Accepted
    • Priority: Minor - P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: mongoexport
    • Labels:

      Description

      1) --fieldFile option is ignored if using the default JSON output format or if using the --jsonArray option.

      Shouldn't it work like the --fields option which works with either JSON or CSV format?

      noticed in the export.cpp, there's this line which doesn't take the fieldFile parameter into consideration

      if ( hasParam( "fields" ) || csv ) {

      2) with the csv, we return only the fields listed in --fields or --fieldFile since we get specific fields from the object

      but, with JSON, we return the ``_id`` field along with the fields listed in --fields option (and if you specify a field in a subdocument a.b, will return the whole subdocument field a instead of just the a.b) since we do a straight

      out << obj.jsonString();

        Attachments

          Activity

            People

            Assignee:
            backlog-server-tools Backlog - Server Tools Team
            Reporter:
            kay.kim Kay Kim (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: