mongocursor.immortal(3) php man page | unix.com

Man Page: mongocursor.immortal

Operating Environment: php

Section: 3

MONGOCURSOR.IMMORTAL(3) 						 1						   MONGOCURSOR.IMMORTAL(3)

MongoCursor::immortal - Sets whether this cursor will timeout

SYNOPSIS
public MongoCursor MongoCursor::immortal ([bool $liveForever = true])
DESCRIPTION
After remaining idle on the server for some amount of time, cursors, by default, "die." This is generally the behavior one wants. The database cleans up a cursor once all of its results have been sent to the client, but if the client doesn't request all of the results, the cursor will languish there, taking up resources. Thus, after a few minutes, the cursor "times out" and the database assumes the client has gotten everything it needs and cleans up its the cursor's resources. If, for some reason, you need a cursor to hang around for a long time, you can prevent the database from cleaning it up by using this method. However, if you make a cursor immortal, you need to iterate through all of its results (or at least until MongoCursor::dead returns TRUE) or the cursor will hang around the database forever, taking up resources.
PARAMETERS
o $liveForever - If the cursor should be immortal.
RETURN VALUES
Returns this cursor.
ERRORS
/EXCEPTIONS Throws MongoCursorException if this cursor has started iterating. PHP Documentation Group MONGOCURSOR.IMMORTAL(3)
Related Man Pages
mongocursor(3) - php
mongocommandcursor.rewind(3) - php
mongocollection.find(3) - php
mongocursor.info(3) - php
mongocursor.getreadpreference(3) - php
Similar Topics in the Unix Linux Community
User Guide: Posting in the Emergency Forum
New Code Tags (Syntax Highlighting)
Please Welcome Don Cragun as Lead Moderator
Status of UNIX.COM Forum Transformation
The Order of the Wizard's Hat - Lifetime Achievement Award 2019 - Congrats to Wolf Machowitsch