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

like() #164

Closed
Orange-Men opened this issue Oct 8, 2018 · 2 comments
Closed

like() #164

Orange-Men opened this issue Oct 8, 2018 · 2 comments

Comments

@Orange-Men
Copy link

Hi!
branch: "ecto-2.1"
I trying to use like/2.
But something is broken and I get the error:

** (Ecto.QueryError) Invalid expression for MongoDB adapter in where clause in query:
from a in MyApp.Airport,
       where: like(a.city, "Br%"),
       select: a

source code:

    query = from a in Airport, where: like(a.city, "Br%")
    Repo.all(query)
@ankhers
Copy link
Collaborator

ankhers commented Oct 8, 2018

like/2 does not translate to non-SQL databases well. The syntax used is very specific to SQL. Have you taken a look at the regex module that this package provides? Maybe that can help you in this scenario.

@Orange-Men
Copy link
Author

@ankhers Thank you very much!

@ankhers ankhers closed this as completed Oct 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants