-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Simple hasMany not working? #1383
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
Comments
Using the same models, I even tried this to ensure the test was running as expected, but the Is no one else experiencing this in L5.5?
|
OK, I think I see what's happening. First of all, I read that a collection of IDs won't be stored in the So aside from that note, I started stepping through this package, it appears when I save like this:
It creates a However, when I run this code:
It's trying to find all And just had it So where is the breakdown here? Should this package be storing an ObjectId as the foreign key on the I have changed my relationship to look like this, and it works now. But I don't see this referenced anywhere in docs, so I know it's wrong (it will work for now)
EDIT Kind of works. Querying now works, but saving...the foreign key is null. |
For whatever reason, even though composer.json had It all works now. That was frustrating. haha. |
My foreign keys are oid like bellow
in this case hasMany not working... How can i fix this? |
"user_id" : ObjectId("5ad2612e1c76fb0c28000922"), objectID not result
checking successed |
Granted I am trying to store both models in the same collection, but that shouldn't be an issue, should it? I tested that theory just in case and changed the collection name on one of the models, still the same issue.
My Models are simple:
Here's my test to try and get the data right:
My expectation is that
$revision->sections
will be a Collection with one item in it, and$section
will have arevision_id
property.However there is no
$revision->sections
collection (there is no sections property period).revision_id
is created on the Standard model, and has the correct id as a string.This seems pretty straight forward and set it up according to any docs I have found. Why isn't this working? I'm on Laravel 5.5 and this package is set to
"jenssegers/mongodb": "^3.3",
EDIT: I now see the L5.5 compatibility version seems to be (recently was) in Alpha. The README mentions that 3.3 should work with L5.5 though.
Am I doing something wrong or this an upgrade bug?
The text was updated successfully, but these errors were encountered: