You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello
The _id autocast is a problem on HasOne and HasMany relations, as it prevents comparisons with ObjectId
publicfunctiongetIdAttribute($value = null)
{
// If we don't have a value for 'id', we will use the MongoDB '_id' value.// This allows us to work with models in a more sql-like way.if (! $value && array_key_exists('_id', $this->attributes)) {
$value = $this->attributes['_id'];
}
// Convert ObjectID to string.if ($value instanceof ObjectID) {
return (string) $value;
}
if ($value instanceof Binary) {
return (string) $value->getData();
}
return$value;
}
Hello
The _id autocast is a problem on HasOne and HasMany relations, as it prevents comparisons with ObjectId
Indeed, this relationship always returns me null
But if I remove the line
The relation working
The text was updated successfully, but these errors were encountered: