PHP » GoLang |
login |
register |
about
|
GoLang MongoCursor::timeout
request it (359)
GoLang replacement for PHP's MongoCursor::timeout
[edit | history]
MongoCursor::timeout(PECL mongo >=1.0.3) MongoCursor::timeout — Sets a client-side timeout for this query DescriptionA timeout can be set at any time and will affect subsequent queries on the cursor, including fetching more results from the database. Parameters
Return ValuesThis cursor. Errors/ExceptionsCauses methods that fetch results to throw a MongoCursorTimeoutException if the query takes longer than the specified number of milliseconds. ExamplesExample #1 MongoCursor::timeout() example In the following example, the driver will wait forever for the initial database response, and then wait 100ms for subsequent responses.
<?php NotesWarning
This does not cause the MongoDB server to cancel long-running operations; it only instructs the driver to stop waiting for a response and throw a MongoCursorTimeoutException after a set time. If you need to specify a server-side timeout for a query, consider using MongoCursor::maxTimeMS(). See Also
|
more
Recently updated
more
Most requested
more
Last requests
|