Datatable icon indicating copy to clipboard operation
Datatable copied to clipboard

Fix null values with MongoDB distinct

Open foxbit19 opened this issue 9 years ago • 0 comments

During the use of MongoDB driver, the distinct operation doesn't return the expected string key for the array of results. This kind of behaviour, is exclusively relative to MongoDB because the $property doesn't exists, but there is a numeric key for the array instead. The fix I propose, introduces a nullable check for $model[$property] and $model->$property and, if this check verifies the nullability, returns the first element of the array of results (in MongoDB the distinct operation works only on 1 field).

foxbit19 avatar Apr 09 '15 13:04 foxbit19