-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 1.3.3
-
Component/s: CRUD
-
None
-
Environment:linux 4.9.0, mongodb 3.6.14
2020/05/12 23:09:12 Error with mongodb://admins.find(): error decoding key osbuilddate(field OsBuildDate): IntDecodeValue can only truncate float64 to an integer type when truncation is enabled
The trouble is that some data put into mongodb from NodeJS sources, particularly when using parseInt or parseFloat before insertion, is recorded in the db as NaN.
Therefore, when the go driver tries to pull that data out, all find() requests are halted if even a single document has a value of NaN when using Find() to write to a go struct that uses an int64 field.
It seems to me I could rewrite the javascript stuff and just put null or nothing in the event of having a NaN value, however NaN isn't exactly nothing.
I cannot understand the reason that the go driver would fail completely in this situation.
Please help.