Skip to content

Conversation

JPryce-Aklundh
Copy link
Collaborator

@JPryce-Aklundh JPryce-Aklundh commented Sep 25, 2025

ToDo:

  • Replace 2025.xx with actual month of release (currently not confirmed)

Related PRs:

@neo4j-docops-agent
Copy link
Collaborator

Copy link
Collaborator

@Hunterness Hunterness left a comment

Choose a reason for hiding this comment

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

Sorry for not reviewing this before Jens left

* xref:constraints/list-constraints.adoc[]
* xref:constraints/drop-constraints.adoc[]
For reference material about the Cypher commands used to manage constraints, see xref:constraints/syntax.adoc#constraints[Syntax -> Constraints].
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think the syntax page has a Constraints header or tag 🤔

Suggested change
For reference material about the Cypher commands used to manage constraints, see xref:constraints/syntax.adoc#constraints[Syntax -> Constraints].
For reference material about the Cypher commands used to manage constraints, see xref:constraints/syntax.adoc[Syntax].

It may still throw an error if conflicting data, indexes, or constraints exist.
Examples of this are nodes with missing properties, indexes with the same name, or constraints with same schema but a different conflicting constraint type.
As of Neo4j 5.17, an informational notification is returned in case nothing happens showing the existing constraint which blocks the creation.
An informational notification is returned in case nothing happens showing the existing constraint which blocks the creation.
Copy link
Collaborator

Choose a reason for hiding this comment

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

We don't want to keep the info on when the notification was added for Cypher 5 docs?

Suggested change
An informational notification is returned in case nothing happens showing the existing constraint which blocks the creation.
As of Neo4j 5.17, an informational notification is returned in case nothing happens showing the existing constraint which blocks the creation.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was under the general impression we still had these for Cypher 5 to cover the 5.x releases, but has that changed so we don't want to keep it since Cypher 5 was frozen 2025.06?

Comment on lines +193 to +195
|NODE [PROPERTY] UNIQUE[NESS]
|REL[ATIONSHIP] [PROPERTY] UNIQUE[NESS]
|[PROPERTY] UNIQUE[NESS]
Copy link
Collaborator

Choose a reason for hiding this comment

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

No, PROPERTY isn't available for uniqueness constraint filtering in Cypher 5 (it was only added to Cypher 25)

Suggested change
|NODE [PROPERTY] UNIQUE[NESS]
|REL[ATIONSHIP] [PROPERTY] UNIQUE[NESS]
|[PROPERTY] UNIQUE[NESS]
|NODE UNIQUE[NESS]
|REL[ATIONSHIP] UNIQUE[NESS]
|UNIQUE[NESS]

Comment on lines +214 to +216
|NODE [PROPERTY] UNIQUE[NESS]
|REL[ATIONSHIP] [PROPERTY] UNIQUE[NESS]
|[PROPERTY] UNIQUE[NESS]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
|NODE [PROPERTY] UNIQUE[NESS]
|REL[ATIONSHIP] [PROPERTY] UNIQUE[NESS]
|[PROPERTY] UNIQUE[NESS]
|NODE UNIQUE[NESS]
|REL[ATIONSHIP] UNIQUE[NESS]
|UNIQUE[NESS]

This means its default behavior is to throw an error if an attempt is made to drop the same constraint twice.
With the `IF EXISTS` flag, no error is thrown and nothing happens should the constraint not exist.
As of Neo4j 5.17, an informational notification is instead returned detailing that the constraint does not exist.
Instead, an informational notification is returned detailing that the constraint does not exist.
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here as above, shouldn't we keep the introduction version in Cypher 5 docs?

Suggested change
Instead, an informational notification is returned detailing that the constraint does not exist.
As of Neo4j 5.17, an informational notification is instead returned detailing that the constraint does not exist.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was under the general impression we still had these for Cypher 5 to cover the 5.x releases, but has that changed so we don't want to keep it since Cypher 5 was frozen 2025.06?
(I'm adding this part to all comments that are relevant for the 5.x vs calVar updates, you don't need to answer all threads with the same info, was more to be able to separate them from the others that are cypher 5 vs cypher 25 changes)

[source, error]
----
An equivalent constraint already exists, 'Constraint( id=5, name='sequels', type='RELATIONSHIP UNIQUENESS', schema=()-[:SEQUEL_OF {order}]-(), ownedIndex=4 )'.
An equivalent constraint already exists, 'Constraint( id=5, name='sequels', type='RELATIONSHIP PROPERTY UNIQUENESS', schema=()-[:SEQUEL_OF {order}]-(), ownedIndex=4 )'.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
An equivalent constraint already exists, 'Constraint( id=5, name='sequels', type='RELATIONSHIP PROPERTY UNIQUENESS', schema=()-[:SEQUEL_OF {order}]-(), ownedIndex=4 )'.
An equivalent constraint already exists, 'Constraint( id=5, name='sequels', type='RELATIONSHIP UNIQUENESS', schema=()-[:SEQUEL_OF {order}]-(), ownedIndex=4 )'.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was under the general impression we still had these for Cypher 5 to cover the 5.x releases, but has that changed so we don't want to keep it since Cypher 5 was frozen 2025.06?
(I'm adding this part to all comments that are relevant for the 5.x vs calVar updates, you don't need to answer all threads with the same info, was more to be able to separate them from the others that are cypher 5 vs cypher 25 changes)

Comment on lines -829 to -831
[NOTE]
The constraint type will be updated to say `RELATIONSHIP PROPERTY UNIQUENESS` in a future version of Neo4j.
Copy link
Collaborator

Choose a reason for hiding this comment

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

And add back the note (was updated in calVar i believe)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was under the general impression we still had these for Cypher 5 to cover the 5.x releases, but has that changed so we don't want to keep it since Cypher 5 was frozen 2025.06?
(I'm adding this part to all comments that are relevant for the 5.x vs calVar updates, you don't need to answer all threads with the same info, was more to be able to separate them from the others that are cypher 5 vs cypher 25 changes)

[source, error]
----
Constraint already exists: Constraint( id=3, name='book_isbn', type='UNIQUENESS', schema=(:Book {isbn}), ownedIndex=2 )
Constraint already exists: Constraint( id=3, name='book_isbn', type='NODE PROPERTY UNIQUENESS', schema=(:Book {isbn}), ownedIndex=2 )
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here

Suggested change
Constraint already exists: Constraint( id=3, name='book_isbn', type='NODE PROPERTY UNIQUENESS', schema=(:Book {isbn}), ownedIndex=2 )
Constraint already exists: Constraint( id=3, name='book_isbn', type='UNIQUENESS', schema=(:Book {isbn}), ownedIndex=2 )

and the note below

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was under the general impression we still had these for Cypher 5 to cover the 5.x releases, but has that changed so we don't want to keep it since Cypher 5 was frozen 2025.06?
(I'm adding this part to all comments that are relevant for the 5.x vs calVar updates, you don't need to answer all threads with the same info, was more to be able to separate them from the others that are cypher 5 vs cypher 25 changes)

[source, error]
----
Constraint already exists: Constraint( id=7, name='book_title_year', type='UNIQUENESS', schema=(:Book {title, publicationYear}), ownedIndex=6 )
Constraint already exists: Constraint( id=7, name='book_title_year', type='NODE PROPERTY UNIQUENESS', schema=(:Book {title, publicationYear}), ownedIndex=6 )
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Constraint already exists: Constraint( id=7, name='book_title_year', type='NODE PROPERTY UNIQUENESS', schema=(:Book {title, publicationYear}), ownedIndex=6 )
Constraint already exists: Constraint( id=7, name='book_title_year', type='UNIQUENESS', schema=(:Book {title, publicationYear}), ownedIndex=6 )

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was under the general impression we still had these for Cypher 5 to cover the 5.x releases, but has that changed so we don't want to keep it since Cypher 5 was frozen 2025.06?
(I'm adding this part to all comments that are relevant for the 5.x vs calVar updates, you don't need to answer all threads with the same info, was more to be able to separate them from the others that are cypher 5 vs cypher 25 changes)

[source, error]
----
Unable to create Constraint( name='book_title', type='UNIQUENESS', schema=(:Book {title}) ):
Unable to create Constraint( name='book_title', type='NODE PROPERTY UNIQUENESS', schema=(:Book {title}) ):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Unable to create Constraint( name='book_title', type='NODE PROPERTY UNIQUENESS', schema=(:Book {title}) ):
Unable to create Constraint( name='book_title', type='UNIQUENESS', schema=(:Book {title}) ):

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was under the general impression we still had these for Cypher 5 to cover the 5.x releases, but has that changed so we don't want to keep it since Cypher 5 was frozen 2025.06?
(I'm adding this part to all comments that are relevant for the 5.x vs calVar updates, you don't need to answer all threads with the same info, was more to be able to separate them from the others that are cypher 5 vs cypher 25 changes)

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants