Properly passing mongodb ISODate in R
Date : March 29 2020, 07:55 AM
it should still fix some issue I'm trying to read data from MongoDB to R through RMongo: , Changing ISODate to an R's version of it worked: ISOdate(year=2008, month=1, day=1, hour=0)
|
Insert MongoDB ISODate PHP
Tag : php , By : Brian Cupps
Date : March 29 2020, 07:55 AM
this will help not sure if you still need this, but i have been struggling a lot with this. Finally i have been able to figure it out. $orig_date = new DateTime('2016-01-22 14:00:00');
# or you can use any other way to construct with (int timestamp)
$mongo_date = new MongoDB\BSON\UTCDateTime($orig_date->getTimestamp());
$filter = [
....
....
['timestamp' => ['$gte' => $mongo_date]],
....
....
]
# create command (for example aggregation)
$cmd = new MongoDB\Driver\Command( $filter );
# execute command
$cursor = $manager->executeCommand('my_mongo_db_name', $cmd);
|
MongoDB ISODate query with PHP
Tag : php , By : baylisscg
Date : March 29 2020, 07:55 AM
like below fixes the issue You have to use MongoDate object to query. For current date you may use new MongoDate() which make MongoDate initialize with current Date $stringtime = "2016-04-09 00:00:00"
$inputdate = strtotime($stringtime)
new MongoDate($inputdate)
|
Convert a ISODate string to mongoDB native ISODate data type
Date : March 29 2020, 07:55 AM
|
How to Convert mongodb ISODate to string in mongoDB?
Date : March 29 2020, 07:55 AM
|