Question

I'm trying to load an 80 meg JSON file into mongodb using the following command:

mongoimport --db qt --collection cftable --type json --file cftable.json --jsonArray

What I get from mongoimport is the following:

2014-05-12T14:16:00.338-0500 check 0 0 2014-05-12T14:16:00.338-0500 imported 0 objects encountered 1 error(s)

Here's what a sample record looks like - there are roughly 65,000 of these. None approach 16 mg. The entire file is 80 mb. Is there a way I can break down the import in a way that would allow me to narrow down the problem? Or am I barking up the wrong tree with mongoimport to do something like this?

[ { "last_name": "Jones", "first_name": "Johny", "middle_name": "J.", "nick_name": "", "gen_qual": "", "degree": "Ph.D.", "specialty": "LabM & Path", "voting_staff_flag": "1", "start_date": "Jan 1 1900 12:00:00:000AM", "end_date": "Dec 31 2599 11:59:00:000PM", "time_code": "All Day", "resident_or_fellow_flag": "0", "smtp_address": "Jones.Johny@mayo.edu", "per_id": "12345678", "rank": "Cons", "committee_member": "Y", "point_entity": "Somewhere", "s_last_name": "JONES", "s_first_name": "JOHNY", "ALT_IDENTIFIER_1": "JONESJ", "ALT_IDENTIFIER_2": "MRE2222", "ALT_IDENTIFIER_3": "SO_ST_02_50-EP", "ALT_IDENTIFIER_4": "123456", "campus_name": "Somewhere, Ohio", "work_locations": [ { "w_ai": 17395220, "work_location_sort": 15, "building": "Rexell Building", "floor": "2", "area": "Experimental Pathology", "pager": "111 or (11)5-5555", "phone": "(11)9-9999", "supports": [ { "support_sort": 0, "support_desc": " ", "support_note": " ", "support_phone": " ", "support_start_date": "", "support_end_date": "" } ] }, { "w_ai": 174956, "work_location_sort": 25, "building": "Rexell Building", "floor": "2", "area": "Laboratory", "pager": "111 or (11)1-1111", "phone": "(11)2-2222", "supports": [ { "support_sort": 15, "support_desc": "Medical Secretary", "support_note": " ", "support_phone": "(11)6-6666", "support_start_date": "Jan 1 1900 12:00:00:000AM", "support_end_date": "Dec 31 2599 12:00:00:000AM" } ] } ] } ''' ]

Was it helpful?

Solution

I would insert your record into MongoDB, do a mongoexport -- and compare that file against your file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top