[JAVA-2126] dup key on @CompoundIndexes Created: 27/Feb/16 Updated: 11/Sep/19 Resolved: 29/Feb/16 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | None |
| Affects Version/s: | 3.2.2 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | sorabh sahu | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
java 8, mongo Spring data, |
||
| Description |
|
I have created pojo class and use this annotation:- @CompoundIndexes(value = { @CompoundIndex(name = "Metadata _ind1", def = " {'index': 1, 'projectId': 1}", unique = true) }) and after sum updation on my list of documents i am saving my updates in collection by using mononRepository.save(updatedList) com.mongodb.MongoException$DuplicateKey: { "serverUsed" : "localhost:27017" , "ok" : 1 , "n" : 0 , "updatedExisting" : false , how can i solve this |
| Comments |
| Comment by Ross Lawley [ 29/Feb/16 ] |
|
The JAVA project is intended for reporting bugs against or requesting new features in the MongoDB Java driver. Please direct general usage questions about the driver or about MongoDB to our user forum or to Stack Overflow. As this question seems related to Mongo Spring Data so posting on their forums may also they spring data community to be of assistance. Regards, |