Inserting field with `undefined` value inserts `null` instead of `undefined`
See original GitHub issueFor example:
collection.insert({ name: undefined })
inserts { name: {} }
and not { name: undefined }
. I’m using monk 3.0.4.
The mongo shell inserts { name: undefined }
for same insert command.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9
Top Results From Across the Web
Doctrine inserting NULL values for undefined fields
I suppose this is default behaviour, as it could be treated logical to create a full record in one INSERT statement.
Read more >Unexpected NULL Fields errors when updating or inserting ...
The error statement: "Error: Wrong number of fields in row being inserted" Occurred when passing a null value during insert operations. The ...
Read more >SQL inserting NULL values - w3resource
Inserting NULL values. The SQL INSERT statement can also be used to insert NULL value for a column. Example: Sample table: agents.
Read more >Convert undefined to null on insert/update - MongoDB Jira
Whenever mongosh tries to insert undefined values, those undefined values get converted to null in the driver logic.
Read more >Understanding the difference between null and undefined in ...
A property with a null value must have it explicitly assigned. Properties not defined in an item have an undefined value. In the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
it seems like mongo has connection option
ignoreUndefined
, which could solve this issue. https://mongodb.github.io/node-mongodb-native/2.1/reference/connecting/connection-settings/hum maybe something like: