Scenairo is as follows,
Consider an object which has a autogenerated id with "@ID"
annotation. This gets converted to mongo ObjectId and it works correctly with changestreams.
However when calling saveAll, instead of updating the object, it inserts new object. This is expected as the logic is based on id and id is always new.
My problem is, if i change the id to be a unique identifier based on my code, changestreams functionality stops working. Say for example, i make the id as firstName+postCode, then saveAll works perfectly. The name of the field is id, and is annotated with "@Id"
but has the value of firstName+postCode. This fixes the saveAll issue. However it breaks changestreams.
Please could you let me know if i am doing anything incorrectly. I prefert to use Spring's reactive mongo repository save method instead of findAndModify or mongoReativeTemplate.
Thank you.
Details on the jars used mongodb-driver-reactivestreams 1.11.0
spring-data-mongodb 2.1.9.RELEASE
spring-boot-starter-data-mongodb-reactive 2.1.6.RELEASE
Affects: \2.0.9.RELEASE
Comment From: rstoyanchev
Closing since this is an issue Spring Data MonogoDB. If still relevant, please re-open there.