I verwendet mongoimport -d test -c BB --file=bb.json
Insert JSON-Datei in MongoDB - JSON hat Metadaten und eine weitere Liste mit den aktuellen Daten
auch versuchte ich mongoimport -d test -c BB --jsonArray --file=bb.json
sie nur als einen Datensatz einfügen, anstatt mehrere Datensätze (2900 ca.)
Ich weiß, dass in MongoDB die Daten im Schlüssel: Wert-Paar sein sollten und diese Daten sind in der Liste für aber mit Metadaten auch. Kann ich Daten in diesem Formular selbst importieren, ohne sie in Schlüssel: Wert-Paare umzuwandeln?
Dank Hier die Daten oder Informationen aus Eingabedatei bb.json die ich
----------------------------------------------------------------------
Start of DATA File
{ "data": [
[
"1",
"Andaman and Nicobar Islands",
"NA",
"Port Blair",
"G.B Pant Hospital",
"Atlanta Point",
"744104",
"03192 230628",
"NA",
"NA",
"NA",
"NA",
"NA",
"NA",
"NA",
"NA",
"[=12]12",
"[=93]93"
],
[
"2",
"Andaman and Nicobar Islands",
"NA",
"Port Blair",
"I.N.H.S. Dhanvantri",
"Minni Bay",
"744103",
"03192 248759",
"NA",
"NA",
"NA",
"NA",
"NA",
"NA",
"NA",
"NA",
"NA",
"NA"
],
..... # RECORDS
[
"2946",
"West Bengal",
"NA",
"Murshidabad",
"Lalbagh S.D. Hospital Blood Bank",
"P.O. Lalbagh",
"742149",
"03482 270247",
"NA",
"NA",
"NA",
"NA",
"NA",
"NA",
"NA",
"NA",
"[=24]24",
"[=88]88"
]
],
"fields": [
{ "id": "a", "label": "id", "type": "string" },
{ "id": "b", "label": "state", "type": "string" },
{ "id": "c", "label": "city", "type": "string" },
{ "id": "d", "label": "district", "type": "string" },
{ "id": "e", "label": "h_name", "type": "string" },
{ "id": "f", "label": "address", "type": "string" },
{ "id": "g", "label": "pincode", "type": "string" },
{ "id": "h", "label": "contact", "type": "string" },
{ "id": "i", "label": "helpline", "type": "string" },
{ "id": "j", "label": "fax", "type": "string" },
{ "id": "k", "label": "category", "type": "string" },
{ "id": "l", "label": "website", "type": "string" },
{ "id": "m", "label": "email", "type": "string" },
{ "id": "n", "label": "blood_component", "type": "string" },
{ "id": "o", "label": "blood_group", "type": "string" },
{ "id": "p", "label": "service_time", "type": "string" },
{ "id": "q", "label": "latitude", "type": "string" },
{ "id": "r", "label": "longitude", "type": "string" }
]
}
END of DATA File -----------------------------------------------------------------------