Skip to content

docs: Document vector values as Dart iterables#697

Merged
marcelomendoncasoares merged 2 commits into
serverpod:mainfrom
marcelomendoncasoares:docs/vector-iterable
Jul 22, 2026
Merged

docs: Document vector values as Dart iterables#697
marcelomendoncasoares merged 2 commits into
serverpod:mainfrom
marcelomendoncasoares:docs/vector-iterable

Conversation

@marcelomendoncasoares

@marcelomendoncasoares marcelomendoncasoares commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Vector, HalfVector, SparseVector, and Bit implement Iterable and support indexed access with operator[], but the vector fields page only covered the YAML declarations. This adds a short section showing how to read the values from Dart.

Changes

  • Add a "Reading vector values in Dart" section to the vector and geography fields page.
  • Show length, indexed access, for-in, common iterable methods, and toList().
  • Document the element type per vector type: double for Vector, HalfVector, and SparseVector, bool for Bit.
  • Explain that a SparseVector iterates over every dimension and returns 0.0 for the dimensions it does not store.

Reference

Avoid opening sentences with code spans, drop the RangeError note that
restates standard Dart indexing behavior, and keep the constructor calls
consistent across the examples.
@marcelomendoncasoares
marcelomendoncasoares marked this pull request as ready for review July 21, 2026 18:34
@marcelomendoncasoares
marcelomendoncasoares requested a review from a team July 21, 2026 18:36
@marcelomendoncasoares
marcelomendoncasoares marked this pull request as draft July 21, 2026 18:52
@marcelomendoncasoares
marcelomendoncasoares marked this pull request as ready for review July 21, 2026 18:58

@Zfinix Zfinix left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean PR

@marcelomendoncasoares
marcelomendoncasoares merged commit 05e028f into serverpod:main Jul 22, 2026
5 checks passed
@marcelomendoncasoares
marcelomendoncasoares deleted the docs/vector-iterable branch July 22, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants