Add runnable count(local) examples to the Count Step docs - #3573
Closed
spmallette wants to merge 1 commit into
Closed
Add runnable count(local) examples to the Count Step docs#3573spmallette wants to merge 1 commit into
spmallette wants to merge 1 commit into
Conversation
The count(local) behavior was described only in a prose callout with no executable examples, and the callout omitted the Path case handled by the step. Replace it with explanatory prose covering Collection, Map, Path, and other objects, followed by a runnable example block whose live output shows the count for each object kind. The examples cross-link to fold(), group(), path(), and the path data structure so the behavior can be verified in context. Assisted-by: Kiro:claude-opus-4.8
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 3.7-dev #3573 +/- ##
=============================================
+ Coverage 75.49% 75.51% +0.01%
- Complexity 13161 13178 +17
=============================================
Files 1092 1093 +1
Lines 67208 67254 +46
Branches 7391 7397 +6
=============================================
+ Hits 50742 50789 +47
- Misses 13837 13840 +3
+ Partials 2629 2625 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
Merged with 06e12a8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
count(local)behavior in the Count Step section of the reference documentation was described only in anIMPORTANTprose callout, with no executable examples. The callout also omitted thePathcase: it stated that a count of1is returned "for any other object," butCountLocalStepreturns the path length for aPath.This change:
Collection(number of elements),Map(number of entries),Path(number of objects in the path), and any other object (1).g.V().fold().count(local)→6(Collection)g.V().group().by(label).count(local)→2(Map)g.V(1).out().path().count(local)→2, 2, 2(Path)g.V(1).count(local)→1(any other object)fold(),group(),path(), and the path data structure so a reader can follow the behavior in context.The reference book builds and the count-step section reads coherently with the rendered live output matching the documented counts.