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
Lost field value annotated with @MongoId
#4197
Comments
spring-projects-issues
added
the
status: waiting-for-triage
An issue we've not yet triaged
label
Oct 10, 2022
seems same to #4184 |
I might be missing something but I cannot reproduce the issue on current main and 3.4.x branches. class RawStringId {
@MongoId String id;
String value;
}
template.dropCollection(RawStringId.class);
RawStringId source = new RawStringId();
source.id = "abc";
source.value = "new value";
template.save(source);
org.bson.Document dbDoc = collection.find().limit(1).cursor().next();
assertThat(dbDoc).isNotNull();
assertThat(dbDoc.get("_id")).isEqualTo("abc"); Please take the time to provide a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem. |
christophstrobl
added
status: waiting-for-feedback
We need additional information before we can continue
and removed
status: waiting-for-triage
An issue we've not yet triaged
labels
Oct 11, 2022
should invoke |
spring-projects-issues
added
status: feedback-provided
Feedback has been provided
and removed
status: waiting-for-feedback
We need additional information before we can continue
labels
Oct 11, 2022
ah - thank you very much @wujimin ! |
christophstrobl
added
type: bug
A general bug
and removed
status: feedback-provided
Feedback has been provided
labels
Oct 11, 2022
you are welcome~ |
mp911de
changed the title
lost field value annotated with @MongoId after upgrade springboot from 2.7.0 to 2.7.4
Lost field value annotated with Oct 12, 2022
@MongoId
mp911de
added
type: regression
A regression from a previous release
and removed
type: bug
A general bug
labels
Oct 12, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
problem
the value of "_id" saved to mongo:
Possible Solutions
spring-data-mongodb/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/QueryOperations.java
Line 275 in a572580
maybe should change this line to
if (entity == null || source.hasId()) {
The text was updated successfully, but these errors were encountered: