nullToNA is used to convert any NULL values to NA in a list.
Usage
nullToNA(x)
Arguments
x
A list.
Value
x with all NULL at the top level of the list replaced by NA.
Details
This function is used when reading vectors from mongoDB. If the original
vector had a value of NA, rmongodb converts to NULL before writing to the
database. When rmongodb performs a find, these NULL values are left as NULL,
and when unlisted will shorten the vector. Before unlisting the vector, this
function is run to convert the NULL values to NA so that the vector remains
the correct length and that NAs are in the correct positions.