Forum Academy Marketplace Showcase Pricing Features

"minus item: first item..." expected behavior?

If I have a list of fruits:

  1. apple
  2. pear
  3. pear
  4. banana

If I do

list of fruits : minus item : list of fruits : first item

The result is

  1. pear
  2. pear
  3. banana

But I repeat

list of fruits : minus item : list of fruits : first item

I end up with:

  1. banana

Shouldn’t I end up with

  1. pear
  2. banana?

Seems like a bug.

1 Like

@rico.trevisan I think I ran into this as well; I think it’s a bug, too!

The second iteration removed all “pear” items. If “pear” is a text (string) — and so, any instance of “pear” is identical to any other instance of “pear” — this is expected Bubble behavior, as Bubble lists are not exactly like JavaScript arrays — they do not contain duplicates.

Doing :minus item will remove all instances of item.

The workaround (again, not a workaround as the above is expected) is to return items number 2 to :count.

2 Likes

Makes sense. Thanks for the explanation Keith.

This topic was automatically closed after 70 days. New replies are no longer allowed.