i'm a beginner in MongoDB so i have a couple of question about it. First of all my code is written in PHP. My context of use is as follows:
{
"_id": "58c91c8059b0a500083dab0c","year": "2017","month": "03","day": "15","data": {"key-1": "value-1","key-2": "value-2","key-n": "value-n"}
}
I would like to get all document with a specific key and sum their value. So i used this code:
$manager = new \MongoDB\Driver\Manager( MONGO_SERVER );$filter = array ("year" => $_POST['time_year'],"month" => $_POST['time_month'],"day" => $_POST['time_day']);$options = ['projection' => ['_id' => 0],];$query = new \MongoDB\Driver\Query($filter, $options);$rows = $manager->executeQuery('REPORT.productionbacklog', $query);foreach ($rows as $entry) {[..]}
But i'm getting this error:
Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes)
So, from this problem i have this questions:
Any suggestions could be help. Thanks!
P.S. Sorry for my bad english.
- Is PHP the best language for use MongoDB? Node.js could be a better choise?
- Storing a bigger numbers of files ( 80K each day ) could be a problem for MongoDB?