[DOCS-4439] In 2.8 mongoimport and mongoexport support nested/embedded documents Created: 28/Nov/14  Updated: 10/Dec/14  Resolved: 10/Dec/14

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: v1.3.15, mongodb-3.0

Type: Task Priority: Major - P3
Reporter: Gianfranco Palumbo Assignee: Sam Kleinman (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to TOOLS-64 dotted field names should produce nes... Closed
Participants:
Days since reply: 9 years, 11 weeks, 5 days ago

 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
	}
}


Generated at Thu Feb 08 07:47:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.