You can't use SQL in a mongodb. You will have to use the query language of MongoDB .
Dec 23, 2021
7
Level 1
How to concat MySQL query into MongoDB
Hello Everyone!
How to combine first name and last name in Laravel, and I am using Mongo Database in db table i have two field first name and last name... i was using laravel eloquent query for fetching records
i was used sql concat but it's not working because of mongoDb
Here my Query
orWhere(\DB::raw("CONCAT(last_name, ' ', first_name)"), 'LIKE', "%".$search."%");
give me some suggestions please
Thank you in advance for your help
Please or to participate in this conversation.