After CSV import Boolean fields are not recognized?

I just imported 1405 records into my database from a CSV file. All looks good with the exception of two Boolean fields. The csv file simply contained a “Y” or “N”. After the import those two colums all want me to convert to boolean. Is there a way to convert all these. Seems it wants me to select the “convert to boolean” for each line. I can’t see myself doing this 1400 times!

Where did you get the Y/N from?
Do you want the columns to be of type boolean?
If your ‘Y’ and ‘N’ are strings and you don’t wish to convert all of them, can you just use them as strings?
Also, you can convert them using a code that would only run once, make a query to the database, and add another boolean field that will be either TRUE or FALSE according to Y and N.

Liran.

I suppose I can just leave them as a text string as they were in the Informix database. Speaking of query, is this now a relational database supporting SQL?

Nope, It is not an SQL database.

Too bad. Anyway, I have simply changed the fields to text. No more DB fields displayed in red.

Maybe late to jump in, but there’s one more thing you can try. Next time you import a Boolean field, there’re additional fields where you can specify how to read True and False values so that they would be imported correctly.

With current situation, if your _id field values do not come with your original CSV, you can export your data from current collection and import it back. Just make sure this time you specify how to read True and False values, and make sure that strategy for matching items under _id field are set to update.

Hope that helps!