mongo import json 文件

mongoimport命令可以导入json文件

现有如下格式的json文件:

[ 
{
"title":"Introduction",
"url":"http://courses.engr.illinois.edu/cs598jhm/sp2013/Slides/Lecture01.pdf",
"description":""
}
,
{
"title":"Conjugate priors",
"url":"http://courses.engr.illinois.edu/cs598jhm/sp2013/Slides/Lecture02.pdf",
"description":"T. Griffiths and A. Yuille A primer on probabilistic inference; Chapters 8 and 9 of D. Barber Bayesian Reasoning and Machine Learning. See also this diagram of conjugate prior relationships"
}
]

现要将其导入mongodb中,方法:

mongoimport --db ML_OER --collection lecture --file /home/tmp/course_temp.json  --jsonArray

你可能感兴趣的:(mongodb,json,import)