Hi All,
I am hoping there is a way to update a property in a mongo document without having to retrieve and save the entire object.
For example, if I use the Mongo template, I could do:
This will allow me to update just the last name of the "Person" document without having to retrieve the entire "Person" document and update the object and then save.Code:template.upsert(query(where("_id").is("123asd"), update("lastName", lastName), Person.class);
Is there a construct that will allow me to use the repository and do selective updates or do I have to revert to using the mongo template to update a field in the document?
Is there something like:
Thanks,Code:@ModifyingQuery @Query("{ _id : { $eq : '123asd' }, upsert {'lastName', ?0}}") public abstract void updateLastName(String lastName);
Tom


Reply With Quote
