Geen cache-versie.


Caching uitgeschakeld. Standaardinstelling voor deze pagina:ingeschakeld (code LNG204)
Als het scherm te langzaam is, kunt u de gebruikersmodus uitschakelen om de cacheversie te bekijken.

Rechercher une fonction PHP

MongoClient::killCursor

(PECL mongo >=1.5.0)

MongoClient::killCursorKills a specific cursor on the server

This extension that defines this method is deprecated. Instead, the MongoDB extension should be used. There is no equivalent for this method in the new extension.

Description

public MongoClient::killCursor ( string $server_hash , int|MongoInt64 $id ) : bool

In certain situations it might be needed to kill a cursor on the server. Usually cursors time out after 10 minutes of inactivity, but it is possible to create an immortal cursor with MongoCursor::immortal() that never times out. In order to be able to kill such an immortal cursor, you can call this method with the information supplied by MongoCursor::info().

Eerste pagina van Manuel PHP  Inhoudsopgave Haut

Parameters

server_hash

The server hash that has the cursor. This can be obtained through MongoCursor::info().

id

The ID of the cursor to kill. You can either supply an int containing the 64 bit cursor ID, or an object of the MongoInt64 class. The latter is necessary on 32 bit platforms (and Windows).

Eerste pagina van Manuel PHP  Inhoudsopgave Haut

Return Values

Returns TRUE if the method attempted to kill a cursor, and FALSE if there was something wrong with the arguments (such as a wrong server_hash). The return status does not reflect where the cursor was actually killed as the server does not provide that information.

Eerste pagina van Manuel PHP  Inhoudsopgave Haut

Errors/Exceptions

This method displays a warning if the supplied server_hash does not match up with an existing connection. No attempt to kill a cursor is attempted in that case either.

Eerste pagina van Manuel PHP  Inhoudsopgave Haut

Examples

Example #1 MongoClient::killCursor() example

This example shows how to connect, do a query, obtain the cursor information and then kill the cursor.

<?php
$m 
= new MongoClient();
$c $m->testdb->collection;
$cursor $c->find();
$result $cursor->next();

// Now the cursor is valid, so we can get the hash and ID out:
$info $cursor->info();

// Kill the cursor
MongoClient::killCursor$info['server'], $info['id'] );
?>
Zoek een PHP-functie

Vertaling niet beschikbaar

De PHP-handleiding is nog niet in het Nederlands vertaald, dus het scherm is in het Engels. Als u wilt, kunt u het ook in het Frans of in het Duits raadplegen.

Als je de moed voelt, kun je je vertaling aanbieden ;-)

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 30/01/2003 gemaakt, de laatste keer de 26/10/2018 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/php-rf-mongoclient.killcursor.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : http://php.net

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.

Inhoudsopgave Haut