Skip to content

Tag: mongodb

Error when saving data on a specific date and time

I have a server with Debian 10,Apache/2.4.38, MySQLi, mongodb and Php. The server is running a custom PHP program which allows users to upload their measurements (in .csv files) which are then stored in mongodb. The uploaded .csv files must comply with a predetermined format in order to be uploaded, like so: …

Add Timestamp while insertMany() in mongoDB

Hi I am MySQL user and new to mongoDB. I get data from my IOT devices as following: I am inserting it into mongoDB using PHP CodeIgnitor as following: data is getting inserted in collection named as given key as following: Now I want to add timestamp to every row getting inserted. I want data getting inserted…

Trying to iterate over a mongodb cursor twice – failing

I am executing a query against my mongodb database… and then in two separate spots in my front end logic, I need to iterate through the results to extract / show different information. Problem The second time I try to iterate through, I get the following error message: Fatal error: Uncaught MongoDBDrive…

Mongodb aggregate group by day (php)

I have a collection with documents that look like this: I want to group and count these documents based on the accountCreated date (count per day), but I am stuck with the handling of dates since the date includes time as well. This is what I have, but it returns the count including the time, witch means lots…