Skip to content

how is one supposed to chain "and" with "or" #3

@buckyball

Description

@buckyball

maybe a simple question, but I cannot make it work. Example:

from(article).where( "customerNr", eq(custno) )
          .and    ("articlenumber_intern", startsWith(searchTerm))
          .or     ("articlenumber_extern", startsWith(searchTerm))
          .all()

that way, coolection will only return items that are matched by "articlenumber_intern", ignoring the "or" criteria.

Oh, btw, as you can see I added a "startsWith" critera because the contains function wasn't sufficient for me. I would like to suggest to add it in your coolection lib, as this seems to be a common requirement when working with lists.

Thanks for your wonderful little helper, coolection rocks
!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions