-
Notifications
You must be signed in to change notification settings - Fork 1.5k
-
Hi
My server was good until yesterday and now it's showing this error:
Failed to send "count" command with database "dddb": socket error or timeout
at /var/www/html/console/vendor/mongodb/mongodb/src/Operation/Count.php:154
150| if (isset($this->options['readConcern']) && ! \MongoDB\server_supports_feature($server, self::$wireVersionForReadConcern)) {
151| throw UnsupportedException::readConcernNotSupported();
152| }
153|
154| $cursor = $server->executeReadCommand($this->databaseName, new Command($this->createCommandDocument()), $this->createOptions());
155| $result = current($cursor->toArray());
156|
157| // Older server versions may return a float
158| if ( ! isset($result->n) || ! (is_integer($result->n) || is_float($result->n))) {
Exception trace:
1 MongoDB\Driver\Server::executeReadCommand("dddb", Object(MongoDB\Driver\Command), [Object(MongoDB\Driver\ReadPreference)])
/var/www/html/console/vendor/mongodb/mongodb/src/Operation/Count.php:154
2 MongoDB\Operation\Count::execute(Object(MongoDB\Driver\Server))
/var/www/html/console/vendor/mongodb/mongodb/src/Collection.php:277
Please use the argument -v to see more details.
It would be really very helpful if you give me a solution.
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments
-
@apsbd Failed to send "count" command with database "dddb": socket error or timeout
looks like connect error
Beta Was this translation helpful? Give feedback.
All reactions
-
I have same similar issue with the count()
timeout
While looking at mongo docs I noticed this note
MongoDB drivers compatible with the 4.0 features deprecate their respective cursor and collection count() APIs in favor of new APIs for countDocuments() and estimatedDocumentCount(). For the specific API names for a given driver, see the driver documentation.
How can I call countDocuments()
or estimatedDocumentCount()
methods with this library?
Beta Was this translation helpful? Give feedback.