-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
auto_unbox = T destroyed by POSIXt = 'mongo' in toJSON() #194
Comments
Same issue here #192 it seems a bug in automatic conversion to mongo timestamp
Your workaround converts to scalar, so it works and at the moment i guess we have only these two solutions: unbox or direct list wrapper with $date Note for So it works with
But it shows an error with
This is due to the attribute
|
Maybe the same as jeroen/mongolite#198 ... |
This does not work if the tzone attribute is not your current time zone, as removing the tzone attribute modifies the time value. Any other suggestion how to deal with that case? |
When doing:
toJSON(list(t = Sys.time()), POSIXt = 'mongo', auto_unbox = T)
I expected:
{"t":{"$date":1501530029411}}
But I get:
{"t":[{"$date":1501530029411}]}
Workaround by using unbox() directly:
toJSON(list(t = unbox(Sys.time())), POSIXt = 'mongo', auto_unbox = T)
The text was updated successfully, but these errors were encountered: