Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-4439

In 2.8 mongoimport and mongoexport support nested/embedded documents

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: None
    • Fix Version/s: v1.3.15, mongodb-3.0
    • Component/s: manual
    • Labels:
      None
    • Last comment by Customer:
      false
    • Actual Time:
      4

      Description

      For example:

      mongo test --quiet --eval "db.test.drop(); db.test.insert({name:'richard', tel: {type: 'mobile', value:101010}}); printjson(db.test.findOne())" && \
      mongoexport --csv --db test -c test -f 'name,tel.type,tel.value' -o file.csv && \
      mongoimport --type csv -d test -c test --file file.csv --headerline --drop && \
      mongo test --quiet --eval "printjson(db.test.findOne())"

      {
      	"_id" : ObjectId("54783ea521993726baf8bdb1"),
      	"name" : "richard",
      	"tel" : {
      		"type" : "mobile",
      		"value" : 101010
      	}
      }
      2014-11-28T09:21:41.407+0000	connected to: localhost
      2014-11-28T09:21:41.407+0000	exported 1 record
      2014-11-28T09:21:41.416+0000	connected to: localhost
      2014-11-28T09:21:41.417+0000	dropping: test.test
      2014-11-28T09:21:41.418+0000	imported 1 document
      {
      	"_id" : ObjectId("54783ea5a67a06329c2e539f"),
      	"name" : "richard",
      	"tel" : {
      		"type" : "mobile",
      		"value" : 101010
      	}
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sam.kleinman Sam Kleinman (Inactive)
              Reporter:
              gianfranco Gianfranco Palumbo
              Participants:
              Last commenter:
              Jonathan Dahl Jonathan Dahl
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since reply:
                7 years, 2 weeks ago
                Date of 1st Reply: