Iterate over instances
- async AsyncCogniteClient.data_modeling.instances.__call__(
- chunk_size: int | None = None,
- instance_type: Literal['node', 'edge'] = 'node',
- limit: int | None = None,
- include_typing: bool = False,
- sources: Source | Sequence[Source] | None = None,
- space: str | SequenceNotStr[str] | None = None,
- sort: list[InstanceSort | dict] | InstanceSort | dict | None = None,
- filter: Filter | dict[str, Any] | None = None,
- debug: DebugParameters | None = None,
Iterate over nodes or edges. Fetches instances as they are iterated over, so you keep a limited number of instances in memory.
- Parameters:
chunk_size (int | None) – Number of data_models to return in each chunk. Defaults to yielding one instance at a time.
instance_type (Literal['node', 'edge']) – Whether to query for nodes or edges.
limit (int | None) – Maximum number of instances to return. Defaults to returning all items.
include_typing (bool) – Whether to return property type information as part of the result.
sources (Source | Sequence[Source] | None) – Views to retrieve properties from.
space (str | SequenceNotStr[str] | None) – Only return instances in the given space (or list of spaces).
sort (list[InstanceSort | dict] | InstanceSort | dict | None) – Sort(s) to apply to the returned instances. For nontrivial amounts of data, you need to have a backing, cursorable index.
filter (Filter | dict[str, Any] | None) – Advanced filtering of instances.
debug (DebugParameters | None) – Debug settings for profiling and troubleshooting.
- Yields:
Edge | EdgeList | Node | NodeList – yields Instance one by one if chunk_size is not specified, else NodeList/EdgeList objects.