Skip to content
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

Weird behaviour in string match operation in expression #1758

Closed
cihantoraman opened this issue Mar 11, 2022 · 1 comment
Closed

Weird behaviour in string match operation in expression #1758

cihantoraman opened this issue Mar 11, 2022 · 1 comment
Labels
question Questions about use, potential features, or improvements

Comments

@cihantoraman
Copy link

Support Question

I have a question about "match" operator. I don't know if I have a false expectation or it's a bug. Can you please help me to understand correctly.

In my case,
Expression is:
// mike_zero if (match("name", 'Mike')) {"size" * 0} else {"size"}

With a couple of update and delete operation below, I encounter this issue in the image. If I understood correctly, mike_zero column of Sarah should not be zero.

/**
* STEP 1 ************************
*/
        await table.update([{
          "index": "1",
          "name": "Mike",
          "size": 0.74
        }])

/**
* STEP 2 ************************
*/
        await table.update([{
          "index": "2",
          "name": "Sarah",
          "size": 0.32
        }])

/**
* STEP 3 ************************
*/
        await table.remove(["1"]);

image

Here is the full code:
https://jsfiddle.net/20hw7ajf/2/

Please let me know if there is anything wrong in implementation.
Thank you.

@timkpaine timkpaine added the question Questions about use, potential features, or improvements label Jun 21, 2022
@adetsi
Copy link
Contributor

adetsi commented Aug 16, 2023

Hi @cihantoraman I believe this issue has been resolved by @texodus on PR #2311 . Please see diagrams below. @texodus could you please confirm this?

Without remove

without_remove

Removing index 1 value

with_remove

@texodus texodus closed this as completed Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Questions about use, potential features, or improvements
Projects
None yet
Development

No branches or pull requests

4 participants