Chapter - 3 Boolean

I tried to add a boolean field in a document but that field is added as an “array” but Not just a boolean value true or false.

{"_id":{"$oid":"5c8eccc1caa187d17ca72f8d"},"city":"NEW YORK","zip":"10005","loc":{"y":{"$numberDouble":"40.705649"},"x":{"$numberDouble":"74.008344"}},"pop":{"$numberInt":"202"},"state":"NY","capital?":[false]}

You have to share the code you use to do that so that we can help you find out what is wrong with the way you did that.

1 Like

Did you try $set instead of $push.
I used $push first and then I got an array that contained a boolean. After I tryed $set and that did the trick.

I have resolve that issue. Thank You For your Time.