Saturday, 24 August 2013

how to import json file in mongodb?

how to import json file in mongodb?

i am new to mongodb database . i a creating an application in which data
store as a json file. what i want to do is import that data into mongodb
and then display it on command prompt. i already tried following commands
but error is displaying Failure parsing josn near: } my command is:
mongoimport -d mydb -c mydb --type json --file glossary.json --headerlinei
put json file in c:\mongodb\bin\glossary.json thanx i advace.
{
"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"
}
}
}
}
}

No comments:

Post a Comment