php man page for mongoprotocolexception

Query: mongoprotocolexception

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

MONGOPROTOCOLEXCEPTION(3)						 1						 MONGOPROTOCOLEXCEPTION(3)

The MongoProtocolException class

INTRODUCTION
When talking to MongoDB 2.6.0, and later, certain operations (such as writes) may throw MongoProtocolException when the response from the server did not make sense - for example during network failure (we could read the entire response) or data corruption. This exception is also thrown when attempting to talk newer protocols then the server supports, for example using the MongoWriteBatch when talking to a MongoDB server prior to 2.6.0.
CLASS SYNOPSIS
MongoProtocolException MongoProtocolExceptionextends MongoException Inherited properties o protected string$message o protected int$code o protected string$file o protected int$line
EXAMPLES
Example #1 Catching MongoProtocolException Running the following example against MongoDB prior to 2.6.0 will throw an MongoProtocolException <?php $mc = new MongoClient("localhost"); $c = $mc->selectCollection("test", "test"); try { $batch = new MongoInsertBatch($c); } catch(MongoProtocolException $e) { echo $e->getMessage(); } ?> The above examples will output something similar to: Current primary does not have a Write API PHP Documentation Group MONGOPROTOCOLEXCEPTION(3)
Related Man Pages
mongodbdrivermanager(3) - php
mongowritebatch(3) - php
pdoexception(3) - php
solrresponse(3) - php
mongodbdrivermanager.__construct(3) - php
Similar Topics in the Unix Linux Community
Simple rules of the UNIX.COM forums:
Coming Soon: Upgrade Forum Software (Dec 31 - Jan 1)
Status of UNIX.COM Forum Transformation
Please Welcome Ravinder Singh to the Moderation Team
The Order of the Wizard's Hat - Lifetime Achievement Award 2019 - Congrats to Wolf Machowitsch