dice icon indicating copy to clipboard operation
dice copied to clipboard

Inconsistent `JSON.FORGET`: Getting null when deleting element from array

Open Dhroov7 opened this issue 1 year ago • 3 comments

Steps to reproduce

  • Create a JSON array in DiceDB.
  • Use the JSON.FORGET command to remove an element from the array.
  • Observe the resulting array.
Screenshot 2024-09-30 at 10 59 51 PM Screenshot 2024-09-30 at 10 59 51 PM

Expected output

The expected output when the above set of commands (maybe when run on Redis)

["element1", "element3"]

Observed output

The observed output when the above set of commands when run on DiceDB

["element1", null, "element3"]

Expectations for resolution

This issue will be considered resolved when the following things are done

  1. changes in the dice code to meet the expected behavior
  2. addition of relevant test case to ensure we catch the regression

You can find the tests under the integration_tests directory of the dice repository and the steps to run are in the README file. Refer to the following links to set up DiceDB and Redis 7.2.5 locally

Dhroov7 avatar Oct 02 '24 07:10 Dhroov7

@JyotinderSingh @lucifercr07 I've created the issue for JSON.FORGET but i'm not able to assign it to myself. Can you please assign this to me?

Dhroov7 avatar Oct 02 '24 07:10 Dhroov7

@JyotinderSingh @lucifercr07 I've created the issue for JSON.FORGET but i'm not able to assign it to myself. Can you please assign this to me?

Assigned

JyotinderSingh avatar Oct 02 '24 07:10 JyotinderSingh

@JyotinderSingh Please review this PR

Dhroov7 avatar Oct 05 '24 10:10 Dhroov7