S

Loading…

Interface

QueryBudgetOptions

Limits on what one server request may cost. Both are optional, and a request that passes a limit fails with a SinterServerError named OperationTimeLimitExceeded or ScanLimitExceeded.

The limits apply to each round trip, not to the whole cursor: a cursor sends them again with every getMore, so each batch gets a fresh budget.

interface QueryBudgetOptions

Defined in packages/driver/src/budget.ts:11

Hierarchy

Properties#

P

maxScanned

#
readonly maxScanned?: number

The most documents the server may examine for the request, counting every document it reads, not only the ones it returns. An index lowers the number. A positive integer.

Defined in packages/driver/src/budget.ts:28

P

maxTimeMS

#
readonly maxTimeMS?: number

The most milliseconds the server may spend on the request. The server looks at the clock while it examines documents, so a limit can be passed by a little before the request stops, and a long sort or group is not interrupted once its documents are read. A positive integer.

This is separate from the client's requestTimeoutMS, which gives up waiting for the answer. Keep requestTimeoutMS larger than maxTimeMS, or the client may stop waiting first.

Defined in packages/driver/src/budget.ts:22

Used by#