Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-4475

'Failed to target upsert by query :: could not extract exact shard key', details={}}.; nested exception is com.mongodb.MongoWriteException:

    XMLWordPrintableJSON

Details

    • Icon: Question Question
    • Resolution: Won't Do
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None

    Description

      Hii,
      We have recently moved to mongo java driver core/sync 4.4.0 from 3.12.1 with spring data mongo db from 2.2.5.RELEASE to 3.3.0 also spring boot version 2.6.2 and mongo server version 4.2.5

      We are getting exceptions while hitting upsert queries on sharded collection with above mentioned error

      There is way to insert shard key in query filter but that is not feasible for us, hence we tried adding @Sharded annotations to our DTO as we have different shard keys for different collections

      Still we are getting the above mentioned error also we are unable to get exact meaning of what is full copy of entity meant in below statement

      update/upsert operations replacing/upserting a single existing document as long as the given UpdateDefinition holds a full copy of the entity.

      Other queries are working fine also upsert queries are working fine on addition of shard key in query filter but that change is not feasible for us we need quick solution

      Please help as not able to find any solution on any platform. Thanks in advance!

       

      Attachments

        Activity

          People

            jeff.yemin@mongodb.com Jeffrey Yemin
            danny@yopmail.com Danny Pandit
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: