我试过这句话:SELECT*FROM table_name它不起作用.从Mongodb中的表中选择所有行的命令或方法是什么?
我有一个数组:
var myArray = [
{question: "Who is Prime Minister of the United Kingdom?",
choices: ["David Cameron", "Gordon Brown", "Winston Churchill", "Tony Blair"],
correctAnswer:0},
{question: "What is the capital of UK?",
choices: ["Paris", "Washington", "London", "Liverpool"],
correctAnswer:2}];
Run Code Online (Sandbox Code Playgroud)
我把它串起来之后.它看起来像这样:
JSON.stringify(myArray)
"[
{
"question":"Who is Prime Minister of the United Kingdom?",
"choices":[
"David Cameron","Gordon Brown",
"Winston Churchill",
"Tony Blair"
],
"correctAnswer":0
},
{
"question":"What is the capital of UK?",
"choices":[
"Paris",
"Washington",
"London",
"Liverpool"
],
"correctAnswer":2
}
]"
Run Code Online (Sandbox Code Playgroud)
哪个是无效的JSON.如何使其有效?