Skip to content

Conversation

@gem-neo4j
Copy link
Contributor

No description provided.

|===
.Deduplicate a list of mixed values, including null
// tag::functions_list_distinct[]
Copy link
Contributor

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.
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@rsill-neo4j rsill-neo4j left a comment

Choose a reason for hiding this comment

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

lgtm

@neo4j-docops-agent
Copy link
Collaborator

This PR includes documentation updates
View the updated docs at https://neo4j-docs-cypher-1408.surge.sh

Updated pages:

Copy link
Contributor

@rsill-neo4j rsill-neo4j left a 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[]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// tag::functions_list_distinct_ints[]

----
RETURN coll.distinct([1, 3, 2, 4, 2, 3, 1])
----
// end::functions_list_distinct_ints[]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// end::functions_list_distinct_ints[]

|===
.Deduplicate a list of mixed values, including null
// tag::functions_list_distinct_mixed[]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// 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[]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// end::functions_list_distinct_mixed[]
// end::functions_list_distinct[]

|===
.Flatten a list to default of depth 1
// tag::functions_list_flatten_default[]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// tag::functions_list_flatten_default[]

----
RETURN coll.flatten(['a', ['b', ['c']]])
----
// end::functions_list_flatten_default[]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// end::functions_list_flatten_default[]

|===
.Search for a value not present in the given list
// tag::functions_list_indexOf_missing[]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// tag::functions_list_indexOf_missing[]

----
RETURN coll.indexOf([1, 'b', false], 4.3)
----
// end::functions_list_indexOf_missing[]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| *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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants