public function remove($col, $cond = [], $cb = null, $params = [])
    {
        if (mb_orig_strpos($col, '.') === false) {
            $col = $this->dbname . '.' . $col;
        }

        if (is_string($cond)) {
            $cond = new \MongoCode($cond);
        }

        if ($this->safeMode && is_array($cond)) {
            static::safeModeEnc($cond);
        }
        try {
            $this->request(
                self::OP_DELETE,
                "\x00\x00\x00\x00" . $col . "\x00" . "\x00\x00\x00\x00" . bson_encode($cond),
                false,
                null,
                function ($conn, $reqId = null) use ($col, $cb, $params) {
                    if (!$conn) {
                        !$cb || $cb(['$err' => 'Connection error.']);
                        return;
                    }
                    if ($cb !== null) {
                        $this->lastError($col, $cb, $params, $conn);
                    }
                }
            );
        } catch (\MongoException $e) {
            Daemon::log('MongoClient exception: ' . $e->getMessage() . ': ' . $e->getTraceAsString());
            if ($cb !== null) {
                $cb(['$err' => $e->getMessage(), '$query' => $cond]);
            }
        }
    }
public function remove($col, $cond = [], $cb = null, $params = [])
    {
        if (mb_orig_strpos($col, '.') === false) {
            $col = $this->dbname . '.' . $col;
        }

        if (is_string($cond)) {
            $cond = new \MongoCode($cond);
        }

        if ($this->safeMode && is_array($cond)) {
            static::safeModeEnc($cond);
        }
        try {
            $this->request(
                self::OP_DELETE,
                "\x00\x00\x00\x00" . $col . "\x00" . "\x00\x00\x00\x00" . bson_encode($cond),
                false,
                null,
                function ($conn, $reqId = null) use ($col, $cb, $params) {
                    if (!$conn) {
                        !$cb || $cb(['$err' => 'Connection error.']);
                        return;
                    }
                    if ($cb !== null) {
                        $this->lastError($col, $cb, $params, $conn);
                    }
                }
            );
        } catch (\MongoException $e) {
            Daemon::log('MongoClient exception: ' . $e->getMessage() . ': ' . $e->getTraceAsString());
            if ($cb !== null) {
                $cb(['$err' => $e->getMessage(), '$query' => $cond]);
            }
        }
    }
public function remove ( $ col , $ cond = [ ] , $ cb = null , $ params = [ ] ) { if ( mb_orig_strpos ( $ col , '.' ) === false ) { $ col = $ this -> dbname . '.' . $ col ; } if ( is_string ( $ cond ) ) { $ cond = new \ MongoCode ( $ cond ) ; } if ( $ this -> safeMode && is_array ( $ cond ) ) { static :: safeModeEnc ( $ cond ) ; } try { $ this -> request ( self :: OP_DELETE , "\x00\x00\x00\x00" . $ col . "\x00" . "\x00\x00\x00\x00" . bson_encode ( $ cond ) , false , null , function ( $ conn , $ reqId = null ) use ( $ col , $ cb , $ params ) { if ( ! $ conn ) { ! $ cb || $ cb ( [ '$err' => 'Connection error.' ] ) ; return ; } if ( $ cb !== null ) { $ this -> lastError ( $ col , $ cb , $ params , $ conn ) ; } } ) ; } catch ( \ MongoException $ e ) { Daemon :: log ( 'MongoClient exception: ' . $ e -> getMessage ( ) . ': ' . $ e -> getTraceAsString ( ) ) ; if ( $ cb !== null ) { $ cb ( [ '$err' => $ e -> getMessage ( ) , '$query' => $ cond ] ) ; } } }
Remove objects from collection
@param  string $col Collection's name
@param  array $cond Conditions
@param  callable $cb Optional. Callback called when response received
@param  array $params Optional. Parameters
@callback $cb ( )
@return void
Remove objects from collection