While creating an application in which data is stored as a JSON file,
I need it to be imported into MongoDB.
I tried to use the following command but got the error --> Failure parsing josn near: }
my command is:
mongoimport -d mydb -c mydb --type json --file glossary.json --headerline
My file is located in C:\mongodb\bin\glossary.json.
Here is the content of my file:
{
"glossary": {
"title": "example glossary",
"GlossDiv": {
"title": "S",
"GlossList": {
"GlossEntry": {
"ID": "SGML",
"SortAs": "SGML",
"GlossTerm": "Standard Generalized Markup Language",
"Acronym": "SGML",
"Abbrev": "ISO 8879:1986",
"GlossDef": {
"para": "A meta-markup language, used to create markup languages such as DocBook.",
"GlossSeeAlso": ["GML", "XML"]
},
"GlossSee": "markup"
}
}
}
}
}