Inserting json date obeject in mongodb from R
I am trying to insert forecasted values from a forecasting model along with timestamps in mongodb from. The following code converts the R dataframe into json and then bson. However,when the result is inserted into mongodb, the timestamp is not recognized as date object. mongo1 <-mongo.create(host = "localhost:27017",db = "test",username = "test",password = "test") rev<-data.frame(ts=c("2017-01-06 05:30:00","2017-01-06 05:31:00","2017-01-06 05:32:00","2017-01-06 05:33:00","2017-01-06 05:34:00"),value=c(10,20,30,40,50)) rev$ts<-as.POSIXct(strptime(rev$ts,format = "%Y-%m-%d %H:%M:%S",tz=""))