Skip to content
This repository was archived by the owner on Apr 17, 2019. It is now read-only.

Conversation

foxbit19
Copy link

@foxbit19 foxbit19 commented Apr 9, 2015

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).

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*).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant