I have a problem with the way php saves data in mongoDB.
I have a .csv file in which I have a field that has to be boolean, so I put 'false' for it.
When I read it with php from .csv, the value is a 'string', which is interpreted by mongoDB as an NOT-empty string, which results in a 'true' value field.
Is there a way to read it like a boolean value?
I found an answer that will partially solve my problem (How to convert string to boolean php), but I want to avoid that part and read it like bool, or at least save it like a bool in mongoDB with the values 'false' => false, and not 'false' => true
No comments:
Post a Comment