I am facing the following problem, which is very rarely reproducible:
Documents get sometimes stored to MongoDB although not triggered by our business logic.
Find attached the class structure for a class where a document got wrongly inserted.
An example of a document representing this class:
Still we end up that sometimes documents show up in MongoDB with the following serialized format:
The corresponding MongoDB log where this document got inserted:
It looks like as if our business logic simply inserts an object of the referred class where no properties are set and an auto-generated ID is created by spring-data-mongodb (which doesn't match our complex typed ID).
Still we log the content of every object before performing a MongoOperations::save() call and there is no log line which shows such an "empty" object. All log lines basically match the following output (with the only difference being the concrete values for the containerId and tenantId property:
I couldn't find any similar issues so I created this ticket. I am not certain whether the problem is within spring-data-mongodb, but I have no reason to belief that our business logic is triggering these wrong inserts (otherwise we would have seen it in the logs). Do you know of any similar occurrences in any spring-data-mongodb version? I am in particular interested why the _id field gets auto-generated although it actually is set.