2016-11-05 69 views
0

我有一大堆,我第一次通過在線工具http://oss.sheetjs.com/js-xlsx/蒙戈出口不工作顯示髒數據

轉換成JSON Excel數據和它的偉大工程。

enter image description here 然後,這裏是轉換後得到的示例json數據。

[ 
    { 
     "status": "Active", 
     "Folio #": "5.042E+11", 
     "address": "13423 NW 5TH PL", 
     "city": "PLANTATION", 
     "Zip Code": "33325", 
     "agent_name": "Carlos Gutierrez PA", 
     "dom": "97", 
     "dates_email_were_sent_on": "-", 
     "listPrice": "290000", 
     "offerPrice": "63.35", 
     "Offer": "183710", 
     "C. Offer": "0", 
     "LU": "0", 
     "C": "Y", 
     "P": "N", 
     "E": "Y", 
     "A": "Y", 
     "Agent Type": "Agent", 
     "phone_no": "(305) 710-9655", 
     "email_address": "[email protected]", 
     "cell_phone": "999-999-9999", 
     "comments": "-", 
     "county": "-", 
     "owner": "-", 
     "last_date_email_sent_on": "11/4/16", 
     "no_of_emails_sent": "1", 
     "last_date_email_open": "-", 
     "no_of_emails_open": "-", 
     "last_date_call_was_made": "-", 
     "call_priority": "-", 
     "user_logged_in": "-" 
    }, 
    { 
     "status": "Active", 
     "Folio #": "5.1427E+11", 
     "address": "3709 WASHINGTON ST", 
     "city": "HOLLYWOOD", 
     "Zip Code": "33021", 
     "agent_name": "Jeanne M. Towne", 
     "dom": "3", 
     "dates_email_were_sent_on": "-", 
     "listPrice": "259000", 
     "offerPrice": "63.35", 
     "Offer": "164070", 
     "C. Offer": "0", 
     "LU": "0", 
     "C": "Y", 
     "P": "N", 
     "E": "Y", 
     "A": "Y", 
     "Agent Type": "Agent", 
     "phone_no": "(954) 234-7653", 
     "email_address": "[email protected]", 
     "cell_phone": "-", 
     "comments": "-", 
     "county": "-", 
     "owner": "-", 
     "last_date_email_sent_on": "11/4/16", 
     "no_of_emails_sent": "1", 
     "last_date_email_open": "-", 
     "no_of_emails_open": "-", 
     "last_date_call_was_made": "-", 
     "call_priority": "-", 
     "user_logged_in": "-" 
    } 
] 

這個數據,我可以使用下面的命令送入蒙戈:

mongoimport --db mean-dev --collection properties --jsonArray --file properties-testData.json 

但是當我嘗試導出的數據,我得到使用下面的命令這個奇怪的數據,它並不甚至包含鍵的值。

mongoimport --db mean-dev --collection properties --drop --jsonArray --file export-mongo.json 



{"_id":{"$oid":"581d50fa23cdd2c137a30526"},"{\"_id\":{\"$oid\":\"581d500123cdd2c137a3050c\"}":"{\"_id\":{\"$oid\":\"581d500123cdd2c137a30514\"}","status":"status","Folio #":"Folio #","address":"address","city":"city","Zip Code":"Zip Code","agent_name":"agent_name","dom":"dom","dates_email_were_sent_on":"dates_email_were_sent_on","listPrice":"listPrice","offerPrice":"offerPrice","Offer":"Offer","C. Offer":"C. Offer","LU":"LU","C":"C","P":"P","E":"E","A":"A","Agent Type":"Agent Type","phone_no":"phone_no","email_address":"email_address","cell_phone":"cell_phone","comments":"comments","county":"county","owner":"owner","last_date_email_sent_on":"last_date_email_sent_on","no_of_emails_sent":"no_of_emails_sent","last_date_email_open":"last_date_email_open","no_of_emails_open":"no_of_emails_open","last_date_call_was_made":"last_date_call_was_made","call_priority":"call_priority","user_logged_in":"user_logged_in"} 
{"_id":{"$oid":"581d50fa23cdd2c137a30521"},"{\"_id\":{\"$oid\":\"581d500123cdd2c137a3050c\"}":"{\"_id\":{\"$oid\":\"581d500123cdd2c137a3050d\"}","status":"status","Folio #":"Folio #","address":"address","city":"city","Zip Code":"Zip Code","agent_name":"agent_name","dom":"dom","dates_email_were_sent_on":"dates_email_were_sent_on","listPrice":"listPrice","offerPrice":"offerPrice","Offer":"Offer","C. Offer":"C. Offer","LU":"LU","C":"C","P":"P","E":"E","A":"A","Agent Type":"Agent Type","phone_no":"phone_no","email_address":"email_address","cell_phone":"cell_phone","comments":"comments","county":"county","owner":"owner","last_date_email_sent_on":"last_date_email_sent_on","no_of_emails_sent":"no_of_emails_sent","last_date_email_open":"last_date_email_open","no_of_emails_open":"no_of_emails_open","last_date_call_was_made":"last_date_call_was_made","call_priority":"call_priority","user_logged_in":"user_logged_in"} 

回答

0

此命令起作用。

mongoexport --jsonArray --db mean-dev --collection屬性--out export-mongo.json