When inserting a data.frame with a POSIXt column containing NAs mongolite throws an
Invalid read of null in state IN_BSON_TYPE error when setting na = "null"
library(mongolite)
mongo <- mongo()
df <- data.frame(date = c(Sys.time(),NA))
mongo$insert(df, auto_unbox = TRUE, na = "null")
#> Error: Invalid read of null in state IN_BSON_TYPE
This does work without the na = "null" option but returns unexpected json format. For all other types, the values are dropped, but here we get {} back
When inserting a data.frame with a POSIXt column containing
NA
smongolite
throws anInvalid read of null in state IN_BSON_TYPE
error when settingna = "null"
This does work without the
na = "null"
option but returns unexpected json format. For all other types, the values are dropped, but here we get{}
backin mongo this is saved as: