In the Node.js MongoDB module passing {ignoreUndefined: true}
as an option to the MongoClient.connect
method seems to not do anything. I believe the expected behavior should be to prevent all undefined
data fields from taking a null
value when being written to the database (causing them to not be stored). Incidentally, passing {ignoreUndefined: true}
to each individual write method does accomplish this.
So, why does passing {ignoreUndefined: true}
to the connect
method not "ignore undefined"? If this is not the expected behavior, then what is?