-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Id deleted on update on MongoDB #3267
Comments
@hacksparrow since you have been working with MongoDB recently, would you like to take a look at this issue yourself? |
Confirming it is a bug. Also confirming, it is reproducible in Thanks for reporting @jdumont0201. I will start fixing it. |
@hacksparrow besides fixing the problem in our MongoDB connector, please add a new test to https://github.com/strongloop/loopback-next/tree/master/packages/repository-tests to ensure consistent behavior across all connectors. I'll update acceptance criteria in the issue description accordingly. |
Would like to get an estimate on the effort to add extra tests so that we can get it done and close this issue. Thanks. |
Hmm, I fixed this in July - loopbackio/loopback-connector-mongodb@c5200e2. Use the latest version of |
Steps to reproduce
Create a new project with CLI
Using CLI, add model, MongoDB datasource, repository and CRUD controller. Add this route to controller
Current Behavior
On MongoDB, the entity had an id after create, but looses it after update. Result is
In memory DB, result is fine:
In Postgres, result is fine as well (tested with numeric ids):
(We are just talking about the runtime variable. The value in db maintains a valid id. )
Expected Behavior
id shouldnt be deleted from updated entity
Link to reproduction sanbox
https://github.com/jdumont0201/loopback-id-issue-demo
(Just edit the datasource json to plug to a MongoDB, couldnt share connection details here)
Versions
Win10
@loopback/cli 1.17.1
@loopback/core": 1.8.4
loopback-connector-mongodb": "^5.0.0
loopback-connector-postgresql": "^3.7.0
Acceptance criteria
The text was updated successfully, but these errors were encountered: