mongodb/node-mongodb-native · error · MongoTailableCursorError
Tailable cursor does not support skip
Error message
Tailable cursor does not support skip
What it means
Thrown as MongoTailableCursorError by FindCursor.skip() when findOptions.tailable is true. Tailable cursors start from the current end of a capped collection and stream new inserts; skip is meaningless for that model and the server does not support it on tailable cursors, so the driver rejects it client-side.
Source
Thrown at src/cursor/find_cursor.ts:487
}
if (typeof value !== 'number') {
throw new MongoInvalidArgumentError('Operation "limit" requires an integer');
}
this.findOptions.limit = value;
return this;
}
/**
* Set the skip for the cursor.
*
* @param value - The skip for the cursor query.
*/
skip(value: number): this {
this.throwIfInitialized();
if (this.findOptions.tailable) {
throw new MongoTailableCursorError('Tailable cursor does not support skip');
}
if (typeof value !== 'number') {
throw new MongoInvalidArgumentError('Operation "skip" requires an integer');
}
this.findOptions.skip = value;
return this;
}
}
View on GitHub (pinned to 3366c21a63)
Solutions
- Remove .skip() on tailable cursors
- If you need to start from a specific point, filter on a timestamp/_id in the query rather than skip
- Use a non-tailable query on the capped collection if you need skip
Example fix
// before
coll.find({}, { tailable: true }).skip(10);
// after
coll.find({ ts: { $gt: lastSeenTs } }, { tailable: true, awaitData: true }); Defensive patterns
Strategy: validation
Validate before calling
function skipSafe(cursor, n) {
if (cursor.findOptions?.tailable) {
throw new Error('cannot skip on a tailable cursor; filter by timestamp/_id instead');
}
return cursor.skip(n);
} Prevention
- Never call .skip() on tailable cursors
- Resume tailing via a filter on a timestamp/_id rather than skip
- Use a non-tailable query when you need skip semantics
When it happens
Trigger: coll.find({}, { tailable: true }).skip(5) or coll.find({}, { tailable: true, awaitData: true }).skip(N).
Common situations: Reusing a find-options preset with skip on a tailable query; attempting pagination semantics on a tailing cursor.
Related errors
- Tailable cursor does not support sorting
- Tailable cursor does not support limit
- Argument for maxAwaitTimeMS must be a number
- Operation "skip" requires an integer
- Cannot specify maxAwaitTimeMS >= timeoutMS for a tailable aw
AI-assisted analysis of mongodb/node-mongodb-native@3366c21a63 (2026-08-04).
Data as JSON: /data/errors/f98fad4846a83ede.json.
Report an issue: GitHub.