Guest User

Untitled

a guest
Jan 19th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. $m = new MongoDBClient("mongodb://localhost:27017");
  2.  
  3. $db = $m->mailchimp;
  4. $collection = $db->users;
  5. $aggregate[] = [
  6. '$group' => [
  7. '_id' => [
  8. 'email_address' => '',
  9. ],
  10. ],
  11. ];
  12. $data=$collection1->aggregate($aggregate);
  13.  
  14. PHP Fatal error: Uncaught MongoDBDriverExceptionCommandException: a group specification must include an _id in /var/www/html/vendor/mongodb/mongodb/src/Operation/Aggregate.php:263
  15. Stack trace:
  16. #0 /var/www/html/vendor/mongodb/mongodb/src/Operation/Aggregate.php(263): MongoDBDriverServer->executeReadCommand('mailchimp', Object(MongoDBDriverCommand), Array)
  17. #1 /var/www/html/vendor/mongodb/mongodb/src/Collection.php(223): MongoDBOperationAggregate->execute(Object(MongoDBDriverServer))
  18. #2 /var/www/html/checklog.php(59): MongoDBCollection->aggregate(Array)
  19. #3 {main}
  20. thrown in /var/www/html/vendor/mongodb/mongodb/src/Operation/Aggregate.php on line 263
  21. ubuntu@marketer-box:/var/www/html$ php checklog.php
  22. PHP Notice: Undefined variable: collection1 in /var/www/html/checklog.php on line 58
  23. PHP Fatal error: Uncaught Error: Call to a member function aggregate() on null in /var/www/html/checklog.php:58
Add Comment
Please, Sign In to add comment