-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong casting in $lookup
relations
#2505
Comments
|
@alcaeus okay, that's not a big issue, I'm fixing it with |
@Siebov do you call the aggregation pipeline from a model? If so, what does that model have defined as relations for the |
@alcaeus this is how I build my query
|
@Siebov does the |
@alcaeus this is
|
I'm not familiar enough with the Laravel relationship types to figure out how If both your |
@alcaeus exactly. |
@Siebov can you show the inverse side of the relationships, i.e. the mapping for |
does you fixing _ids and dates shown as object problem yet |
4.2.3
Description:
I'm using raw query to get data from DB.
There is a few
$lookup
I use. One forrounds
collection another one for theusers
.Parent model has 1 round and 1 user. (1 to 1 relation)
For some reason
user
casts differently fromround
:Round
relation is an object with string_id
and stringified dates.User
is an array of 1 single object, with{ _id: $oid: '.....'}
and dates like"created_at": { "$date": { "$numberLong": "1659863891000" } }
User
:Round
:Expected behaviour
I expect user to be an object (not array of objects) with stringified properties
_id
and dates (not displayed as an objects).The text was updated successfully, but these errors were encountered: