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
Actually, I tried hacking that file and got rid of the error, but now it's just ignoring the $primaryKey setting. So looks like this capability is broken in the latest version.
jim5359
changed the title
Undefined index: warehouseId in /Jenssegers/Mongodb/Query/Builder.php:575
Overriding $primaryKey does not work with find()
Nov 16, 2017
jim5359
changed the title
Overriding $primaryKey does not work with find()
Overriding $primaryKey does not work with find($id)
Nov 16, 2017
I get the error:
Undefined index: myId in /Jenssegers/Mongodb/Query/Builder.php:575
It looks like the Builder class is hard-coded to expect the key as _id:
return $sequence == '_id' ? $result->getInsertedId() : $values[$sequence];
This causes problems when doing a find($id) when you've modified the primaryKey to be something else in the model class.
public $primaryKey = 'myId';
I'm using the latest master version using PHP7 and Mongo 3.4
The text was updated successfully, but these errors were encountered: