I tried uploading data into Mongodb using CSV from Mongodb Compass. In the CSV, some of the fields have Null values stored in them. But, after uploading those fields in Mongo, documents have "Null" stored as String. Is there a way to store Null fields from CSV with the type Null?
"Null"
Null
You can correct easily later:
db.contacts.update({a:"Null"}, {$set: {a: null}},{multi:true} )
or you can remove those fields from the document:
db.contacts.update({a:"Null"}, {$unset: {a:1}},{multi:true} )
2.1m questions
2.1m answers
60 comments
57.0k users