Skip to content

Multipath - DEL - order by array index even if path lengths are different - #531

Merged
oshadmi merged 2 commits into
masterfrom
omer_multi_delarray
Nov 14, 2021
Merged

oshadmi merged 2 commits into
masterfrom
omer_multi_delarray

Conversation

@oshadmi

@oshadmi oshadmi commented Nov 13, 2021 •

Copy link
Copy Markdown
Collaborator

Need to delete a longer path before a shorter path, if longer path has higher array index compared to the shorter path
Fixes #529


r.assertOk(r.execute_command('JSON.SET', 'doc2', '$', '[1, 2, 3]'))
res = r.execute_command('JSON.DEL', 'doc2', '$[2,1,0]')
res = r.execute_command('JSON.DEL', 'doc2', '$[1,2,0]')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why this change?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It was initially in a none-descending order, but was worked around a bug, and now can be restored to a less trivial order which would test the reordering required by DEL.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

So let's keep them both?

Comment thread src/commands.rs Resolved

@MeirShpilraien MeirShpilraien left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Small questions

MeirShpilraien
MeirShpilraien previously approved these changes Nov 14, 2021

@MeirShpilraien MeirShpilraien left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A small suggestion of keep a test and add another. Not a must.

@oshadmi
oshadmi merged commit 1264ec9 into master Nov 14, 2021
@oshadmi
oshadmi deleted the omer_multi_delarray branch November 14, 2021 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSON.DEL doesn't delete all values with recursive descent (..)

2 participants