开发者

MongoVue and Boolean

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 })

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜