Open jonbwhite opened 9 years ago
@jasonjlock A) Would this be solved by having a mapping? B) If it is, should we still address this for cases where there isn't a mapping?
Okay, the problem I encountered was first laravel sent a field that was an array as serialized JSON, since it was the first time on a new index/type, it auto mapped to string, and future requests sent with that field as an array failed at matching the mapping. When I deleted the index/type and tried it again, it auto mapped correctly as an array. So, all that to say, we can get it right, but it required mutators and accessors for the field in Eloquent, so we should probably add default functionality for this in Elkuent models.
IIRC from similar issue with laravel-mongodb this only happens when you pass JSON via a form-data POST
Nested fields are getting stored as strings of JSON, when they should be stored with the JSON structure.