-
Notifications
You must be signed in to change notification settings - Fork 64
Add collection function docs #1408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc
Outdated
Show resolved
Hide resolved
| |=== | ||
| .Deduplicate a list of mixed values, including null | ||
| // tag::functions_list_distinct[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the same tag as in line 61 - they should be different (or we only use one for cheat sheet inclusion)
edit: this also holds for other tags in this PR
| ---- | ||
| // end::functions_list_insert[] | ||
| The original list with a new value inserted at the given index. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since coll.remove talks about shifting, is that aspect relevant here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it probably is, how about:
The original list with a new value inserted at the given index, shifting all the values following by 1.
Co-authored-by: Richard Sill <[email protected]>
Co-authored-by: Richard Sill <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
|
This PR includes documentation updates Updated pages: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed my mind for a couple of tags, after adding the includes for the cheatsheet here:
https://github.com/neo4j/docs-cheat-sheet/pull/262
| ====== | ||
| .Deduplicate a list of integer values | ||
| // tag::functions_list_distinct_ints[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // tag::functions_list_distinct_ints[] |
| ---- | ||
| RETURN coll.distinct([1, 3, 2, 4, 2, 3, 1]) | ||
| ---- | ||
| // end::functions_list_distinct_ints[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // end::functions_list_distinct_ints[] |
| |=== | ||
| .Deduplicate a list of mixed values, including null | ||
| // tag::functions_list_distinct_mixed[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // tag::functions_list_distinct_mixed[] | |
| // tag::functions_list_distinct[] |
| ---- | ||
| RETURN coll.distinct([1, true, true, null, 'a', false, true, 1, null]) | ||
| ---- | ||
| // end::functions_list_distinct_mixed[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // end::functions_list_distinct_mixed[] | |
| // end::functions_list_distinct[] |
| |=== | ||
| .Flatten a list to default of depth 1 | ||
| // tag::functions_list_flatten_default[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // tag::functions_list_flatten_default[] |
| ---- | ||
| RETURN coll.flatten(['a', ['b', ['c']]]) | ||
| ---- | ||
| // end::functions_list_flatten_default[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // end::functions_list_flatten_default[] |
| |=== | ||
| .Search for a value not present in the given list | ||
| // tag::functions_list_indexOf_missing[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // tag::functions_list_indexOf_missing[] |
| ---- | ||
| RETURN coll.indexOf([1, 'b', false], 4.3) | ||
| ---- | ||
| // end::functions_list_indexOf_missing[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // end::functions_list_indexOf_missing[] |
|
|
||
| 1.1+| xref::functions/list.adoc#functions-coll-indexOf[`coll.indexOf()`] | ||
| | `coll.indexOf(list :: LIST<ANY>, value :: ANY) :: INTEGER` | ||
| | Returns the index for the first match of value in the given list, if the value is no present, -1 is returned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| | Returns the index for the first match of value in the given list, if the value is no present, -1 is returned. | |
| | Returns the index of the first match of value in the given list, if the value is no present, -1 is returned. |
| .Details | ||
| |=== | ||
| | *Syntax* 3+| `coll.indexOf(list, value)` | ||
| | *Description* 3+| Returns the index for the first match of a value in the given list or -1 if the value is not present. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| | *Description* 3+| Returns the index for the first match of a value in the given list or -1 if the value is not present. | |
| | *Description* 3+| Returns the index of the first match of a value in the given list or -1 if the value is not present. |
No description provided.