neosqlite.collection.raw_batch_cursor module

class neosqlite.collection.raw_batch_cursor.RawBatchCursor(collection: Collection, filter: dict[str, Any] | None = None, projection: dict[str, Any] | None = None, hint: str | None = None, batch_size: int = 100, pipeline: list[dict[str, Any]] | None = None, session: ClientSession | None = None)[source]

Bases: object

A cursor that returns raw batches of JSON data instead of individual documents.

__init__(collection: Collection, filter: dict[str, Any] | None = None, projection: dict[str, Any] | None = None, hint: str | None = None, batch_size: int = 100, pipeline: list[dict[str, Any]] | None = None, session: ClientSession | None = None)[source]

Initialize a RawBatchCursor object.

Parameters:
  • collection (Collection) – The collection associated with this cursor.

  • filter (dict[str, Any]) – A dictionary representing the filter criteria for the documents.

  • projection (dict[str, Any]) – A dictionary representing the projection criteria for the documents.

  • hint (str) – A string hinting at the index to use for the query.

  • batch_size (int) – The number of documents to return in each batch.

  • pipeline (list[dict[str, Any]]) – An optional aggregation pipeline to execute.

  • session (ClientSession, optional) – A ClientSession for transactions.

batch_size(batch_size: int) RawBatchCursor[source]

Set the batch size for this cursor.

Parameters:

batch_size (int) – The number of documents to return in each batch.

Returns:

This cursor object, for method chaining.

Return type:

RawBatchCursor

_cleanup() None[source]

Clean up temporary tables.