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

mongodump/mongoexport specify projection

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Accepted
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: mongodump
    • Labels:

      Description

      mongodump can use the -q option to limit the documents dumped to a query pattern. However, the results can't be "shaped" with a projection the way a normal query can be. In the absence of SERVER-14880 or SERVER-14881, the only usable option is to iterate the query cursor client-side, and then either

      1. insert the documents into some other database, dump it, and then drop it, or
      2. just printjson the results from inside --eval and redirect stdout to a file.

      This could apply to mongoexport --fields as well.

      Update: consider the possibility of negative projection (aka blacklist) as well, as mentioned in TOOLS-2313. Perhaps we should take a full projection document as Extended JSON?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-tools Backlog - Server Tools Team
              Reporter:
              kevin.pulo Kevin Pulo
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated: