MongoClient::_getWriteProtocol PHP Method

_getWriteProtocol() public method

public _getWriteProtocol ( )
    public function _getWriteProtocol()
    {
        $this->connect();
        if (!$this->replSet) {
            return reset($this->protocols);
        }
        return $this->connectToReplSetPrimary();
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Remove records from this collection
  *
  * @param array $criteria - Description of records to remove.
  * @param array $options  - Options for remove.    "justOne"   Remove at
  *   most one record matching this criteria.
  *
  * @return bool|array - Returns an array containing the status of the
  *   removal if the "w" option is set. Otherwise, returns TRUE.   Fields
  *   in the status array are described in the documentation for
  *   MongoCollection::insert().
  */
 public function remove(array $criteria = [], array $options = [])
 {
     $timeout = MongoCursor::$timeout;
     if (!empty($options['timeout'])) {
         $timeout = $options['timeout'];
     }
     return $this->client->_getWriteProtocol()->opDelete($this->fqn, $criteria, $options, $timeout);
 }
All Usage Examples Of MongoClient::_getWriteProtocol