laravel-mongodb icon indicating copy to clipboard operation
laravel-mongodb copied to clipboard

Error while search $or/$and/$nor entries need to be full objects Laravel Datatable Mongo

Open naveenmanikya opened this issue 2 years ago • 0 comments

Summary of problem or feature request

Searching for any matching string in the Datatable listing is throwing back this error for Mongodb data. "Exception Message:\n\n$or/$and/$nor entries need to be full objects" The query on Object using "like" is returning some results in "recordsTotal" but giving zero results in "recordsFiltered" on console network response.

Code snippet of problem

if( $search_term ){
     $data = Model : : where( 'category', 'like', '%'.$search_term.'%' );
  }

Network Response

draw: 1, recordsTotal: 360, recordsFiltered: 0, data: [],…}
data: []
draw: 1
error: "Exception Message:\n\n$or/$and/$nor entries need to be full objects"
recordsFiltered: 0
recordsTotal: 360

System details

  • Operating System : Windows 10
  • PHP Version : 8.0.14
  • Laravel Version: 8.83.0
  • Laravel-Datatables Version: ~9.0
  • Jenssegers/mongodb: 3.8

naveenmanikya avatar Feb 12 '22 03:02 naveenmanikya