Details
-
Task
-
Resolution: Done
-
Major - P3
-
None
-
3.2.2
-
None
-
None
-
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) })
@Document(collection = "metadata")
public class MetadataCommBean
and after sum updation on my list of documents i am saving my updates in collection by using mononRepository.save(updatedList)
and this statement throws error:-
com.mongodb.MongoException$DuplicateKey: { "serverUsed" : "localhost:27017" , "ok" : 1 , "n" : 0 , "updatedExisting" : false ,
"err" : "E11000 duplicate key error collection: metadata_db.metadata index: Metadata _ind1 dup key: { : \"1.1.2\", : \"11\" }" , "code" : 11000}
how can i solve this