I'd like to know how to insert a boolean with MongoVue tool.
I tried
{
"IsGlobal": True,
}
// error wh开发者_运维技巧en clicking insert button
and
{
"IsGlobal": "True",
}
// it becomes a string
and
{
"IsGlobal": new Boolean("True"),
}
// I get "Unable to parse Json: new Boolean..."
Any help would be appreciate.
Thanks guys !
The answer, is
{
"IsGlobal": true,
}
While inserting you need to make sure you are using proper boolean keywords like (true,false).It should always start from lower case not from capital case.
db.UserCredential.insert({"flag":true}) WriteResult({ "nInserted" : 1 }) db.UserCredential.insert({"flag":false}) WriteResult({ "nInserted" : 1 })
精彩评论