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 query not working on integer fields. #2016

Closed
ultimateakash opened this issue Apr 8, 2020 · 2 comments
Closed

Like query not working on integer fields. #2016

ultimateakash opened this issue Apr 8, 2020 · 2 comments
Labels

Comments

@ultimateakash
Copy link

  • Laravel-mongodb Version: ^3.5
  • PHP Version: 7.3
  • Database Driver & Version: 3.4 (mongo)

Description:

In my project i need to implement search functionality on different columns. on string column it works fine but it didn't work on integer fields.

Steps to reproduce

Just for example

$code = 256;
        
$branch = Branch::where('code','like',"%".$code."%")->first();
        return response()->json([
            'branch' => $branch
        ]);
@Smolevich
Copy link
Contributor

Smolevich commented Apr 9, 2020

@ultimateakash
Regexp is used by string fileds https://docs.mongodb.com/manual/reference/operator/query/regex/

@divine
Copy link
Contributor

divine commented Sep 14, 2020

Closing. PR with the fix has been merged and released.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants