Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $m = new MongoDBClient("mongodb://localhost:27017");
- $db = $m->mailchimp;
- $collection = $db->users;
- $aggregate[] = [
- '$group' => [
- '_id' => [
- 'email_address' => '',
- ],
- ],
- ];
- $data=$collection1->aggregate($aggregate);
- PHP Fatal error: Uncaught MongoDBDriverExceptionCommandException: a group specification must include an _id in /var/www/html/vendor/mongodb/mongodb/src/Operation/Aggregate.php:263
- Stack trace:
- #0 /var/www/html/vendor/mongodb/mongodb/src/Operation/Aggregate.php(263): MongoDBDriverServer->executeReadCommand('mailchimp', Object(MongoDBDriverCommand), Array)
- #1 /var/www/html/vendor/mongodb/mongodb/src/Collection.php(223): MongoDBOperationAggregate->execute(Object(MongoDBDriverServer))
- #2 /var/www/html/checklog.php(59): MongoDBCollection->aggregate(Array)
- #3 {main}
- thrown in /var/www/html/vendor/mongodb/mongodb/src/Operation/Aggregate.php on line 263
- ubuntu@marketer-box:/var/www/html$ php checklog.php
- PHP Notice: Undefined variable: collection1 in /var/www/html/checklog.php on line 58
- 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