Data insertion exception report in spring-data-mongo
1. Background
A uniqueness constraint is added to a collection, and an exception is expected to be thrown when duplicate data is inserted for subsequent processing
Default configuration
When inserting data into the database, if there is a uniqueness constraint conflict, the newly inserted data cannot be inserted, but there is no exception to the insert method.
two。 Solution.
Join