-
Notifications
You must be signed in to change notification settings - Fork 5
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
document the remove clause #101
Conversation
Warning Rate limit exceeded@swilly22 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 21 minutes and 35 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughThe changes introduce a new documentation file, Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 3
🧹 Outside diff range and nitpick comments (2)
cypher/remove.md (2)
4-6
: Consider enhancing the description for better clarity.The current description is concise but could be more informative. Consider mentioning that this is a core Cypher operation and adding a brief note about when/why one might want to use REMOVE.
description: > - REMOVE is used to remove attributes from node and relationships, in addition to - removing labels from nodes. + The REMOVE clause is a core Cypher operation used to remove properties from nodes + and relationships, as well as to remove labels from nodes. This operation is + useful for data cleanup, schema evolution, and maintaining data consistency.
12-19
: Enhance example graph for better coverage.While the current example is good for node operations, consider these improvements:
- Add a visual representation or ASCII diagram of the graph for better understanding
- Include relationships between nodes to demonstrate REMOVE operations on relationship properties
## Example graph + +The following diagram shows our example graph structure: + +```ascii + (Billy:Player) (Andy:Player) + | | + | | + v v + (Lori:Player:Admin)--[r:KNOWS {since: 2020}]-->(Bob:Player) +``` + ```cypher CREATE (billy :Player {name: 'Billy', score: 84}), (andy :Player {name: 'Andy', score: 21}), - (lori :Player:Admin {name: 'Lori', score: 90}) + (lori :Player:Admin {name: 'Lori', score: 90}), + (bob :Player {name: 'Bob', score: 55}), + (lori)-[:KNOWS {since: 2020}]->(bob)</blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used: CodeRabbit UI** **Review profile: CHILL** <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 5570e0821f2f5e387443d3ad16ef4b7fea673658 and 5cec2c95f0a7b60c27367006c66645369a4f868a. </details> <details> <summary>📒 Files selected for processing (1)</summary> * `cypher/remove.md` (1 hunks) </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>🪛 LanguageTool</summary> <details> <summary>cypher/remove.md</summary> [uncategorized] ~49-~49: A punctuation mark might be missing here. Context: ...labels(n) ``` Result: |n.name|abels(n)| |------|--------| |"Lori"|[Player]| ##... (AI_EN_LECTOR_MISSING_PUNCTUATION) --- [uncategorized] ~66-~66: A punctuation mark might be missing here. Context: ...labels(n) ``` Result: |n.name|abels(n)| |------|--------| |"Lori"|[] | (AI_EN_LECTOR_MISSING_PUNCTUATION) </details> </details> <details> <summary>🪛 Markdownlint (0.35.0)</summary> <details> <summary>cypher/remove.md</summary> 33-33: null Tables should be surrounded by blank lines (MD058, blanks-around-tables) --- 49-49: null Tables should be surrounded by blank lines (MD058, blanks-around-tables) --- 66-66: null Tables should be surrounded by blank lines (MD058, blanks-around-tables) </details> </details> </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
## Remove attributes | ||
|
||
The following query removes the 'score' attribute from the node | ||
representing Andy. | ||
|
||
```cypher | ||
MATCH (n {name: 'Andy'}) | ||
REMOVE n.score | ||
RETURN n.name, n.score | ||
``` | ||
|
||
Result: | ||
|n.name|n.score| | ||
|------|-------| | ||
|"Andy"| Null | | ||
|
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.
🛠️ Refactor suggestion
Add missing examples and fix table formatting.
The section should include:
- Example of removing relationship properties
- Example of removing multiple properties at once
- Proper table formatting with surrounding blank lines
## Remove attributes
+### Remove node properties
+
The following query removes the 'score' attribute from the node
representing Andy.
```cypher
MATCH (n {name: 'Andy'})
REMOVE n.score
RETURN n.name, n.score
Result:
+
n.name | n.score |
---|---|
"Andy" | Null |
+### Remove relationship properties
+
+The following query removes the 'since' property from KNOWS relationships:
+
+cypher +MATCH (lori {name: 'Lori'})-[r:KNOWS]->(bob) +REMOVE r.since +RETURN type(r), r.since +
+
+Result:
+
+|type(r)|r.since|
+|-------|-------|
+|"KNOWS"| Null |
+
+### Remove multiple properties
+
+You can remove multiple properties in a single REMOVE clause:
+
+cypher +MATCH (n {name: 'Billy'}) +REMOVE n.score, n.name +RETURN n +
<details>
<summary>🧰 Tools</summary>
<details>
<summary>🪛 Markdownlint (0.35.0)</summary>
33-33: null
Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
</details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
cypher/remove.md
Outdated
## Remove a label from a node | ||
|
||
To remove a label from a node use the REMOVE clause as follows: | ||
|
||
```cypher | ||
MATCH (n {name: 'Lori'}) | ||
REMOVE n:Admin | ||
RETURN n.name, labels(n) | ||
``` | ||
|
||
Result: | ||
|n.name|abels(n)| | ||
|------|--------| | ||
|"Lori"|[Player]| | ||
|
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.
Fix typo and add important notes about label removal.
- There's a typo in the table header ("abels" should be "labels")
- Add a note about attempting to remove non-existent labels
- Fix table formatting
## Remove a label from a node
To remove a label from a node use the REMOVE clause as follows:
+
+Note: Attempting to remove a non-existent label from a node is a no-op operation
+and will not cause an error.
```cypher
MATCH (n {name: 'Lori'})
REMOVE n:Admin
RETURN n.name, labels(n)
Result:
+
-|n.name|abels(n)|
+|n.name|labels(n)|
|------|--------|
|"Lori"|[Player]|
+
<details>
<summary>🧰 Tools</summary>
<details>
<summary>🪛 LanguageTool</summary>
[uncategorized] ~49-~49: A punctuation mark might be missing here.
Context: ...labels(n) ``` Result: |n.name|abels(n)| |------|--------| |"Lori"|[Player]| ##...
(AI_EN_LECTOR_MISSING_PUNCTUATION)
</details>
<details>
<summary>🪛 Markdownlint (0.35.0)</summary>
49-49: null
Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
</details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
cypher/remove.md
Outdated
## Removing multiple labels from a node | ||
|
||
Similar to removing a single label from a node we can use the REMOVE clause | ||
to remove multiple labels in one go | ||
|
||
```cypher | ||
MATCH (n :Player {name: 'Lori'}) | ||
REMOVE n:Admin:Player | ||
RETURN n.name, labels(n) | ||
``` | ||
|
||
Result: | ||
|n.name|abels(n)| | ||
|------|--------| | ||
|"Lori"|[] | |
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.
Fix typo and add clarification about multiple label removal.
- Fix the typo in table header ("abels" should be "labels")
- Add a note about label order independence
- Fix table formatting
## Removing multiple labels from a node
Similar to removing a single label from a node we can use the REMOVE clause
-to remove multiple labels in one go
+to remove multiple labels in one go. The order of labels in the REMOVE clause
+does not matter.
```cypher
MATCH (n :Player {name: 'Lori'})
REMOVE n:Admin:Player
RETURN n.name, labels(n)
Result:
+
-|n.name|abels(n)|
+|n.name|labels(n)|
|------|--------|
|"Lori"|[] |
+
<details>
<summary>🧰 Tools</summary>
<details>
<summary>🪛 LanguageTool</summary>
[uncategorized] ~66-~66: A punctuation mark might be missing here.
Context: ...labels(n) ``` Result: |n.name|abels(n)| |------|--------| |"Lori"|[] |
(AI_EN_LECTOR_MISSING_PUNCTUATION)
</details>
<details>
<summary>🪛 Markdownlint (0.35.0)</summary>
66-66: null
Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
</details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
b650094
to
2628bc6
Compare
2628bc6
to
0b27025
Compare
Fix #100
Summary by CodeRabbit
REMOVE
clause in the Cypher query language, including functionality and examples for removing attributes and labels from nodes and relationships.REMOVE
documentation in the Cypher Language documentation index.