-
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
[Feature Request] Options to ignore auto conversion id to _id #3184
Comments
I am looking for the solution here |
|
What I've done to get rid of the issue is by downgrading the MongoDB driver to version 4.x |
We have no plan to allow usage of DB::collection('products')->raw()->updateMany([], ['$rename' => ['merchant.id' => 'merchant._id']]); If you need to keep both
|
That's too scary since we have a lot of services query the same collection and we don't want to break them. |
I'm also having an issue with this behavior. @GromNaN Would you consider making the |
Could you provide more precision about your data model? Are you using |
They are in embedded documents. In some places, they are structured as EmbedsMany models on a parent model, and in others, they are just arrays of objects stored on a model.
The changes to alias '_id' in results and queries are incredibly problematic for us. We have almost 200 models in our code base. Our API handles about 3.5 million requests a day to ~1000 endpoints. Changing the structure of the data is not a reasonable option for us.
|
@GromNaN Is it known why subfields rename from "id" to "_id" happens in the first place? To be clear, I am talking about subfields in document, not the primary key "_id". Another note, this change should have been in the release notes. Currently there is mentioned only the primary key. All in all, it is problematic for my project as well and at least opt out would be lifesaver. |
We plan to add a setting to disable |
It is superb to hear that! Is there a target version in mind as well or any other indication about timeline? |
Is your feature request related to a problem?
We have a
merchant.id
field in our mongodb document, and after upgrading to mongodb driver 5.1 we encountered issue that mongodb driver modify the where query frommerchant.id
tomerchant._id
which results to unexpected queryDescribe the solution you'd like
It would be good if there's mechanism to whitelisting the fields from auto conversion
.id
to._id
Describe alternatives you've considered
Additional context
This part of code modify all
.id
to._id
The text was updated successfully, but these errors were encountered: