Skip to content

[Feature Request] whereLike #1692

Description

@vesper8

Describe the feature

While we wait for the possibility of https://github.com/vuex-orm/plugin-search being ported to pinia-orm..

I tried doing something like this:

useRepo(Project).query().where('name', 'like', `%${this.query}%`).get();

I didn't get any errors, but it also didn't work.

It would be nice if you could add a whereLike helper.

I ended up going with this

useRepo(Project).query().where('name', (value) => {
  return value.toLowerCase().includes(this.query.toLowerCase());
}).get();

Which works well enough..

Thanks!

Additional information

  • Would you be willing to help implement this feature?

Final checks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions