-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Embedded sharding keys are not correctly picked up from the shardKeySource Document #3590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
type: bug
A general bug
Milestone
Comments
I would be happy to help on this one ;) |
@christian-german thanks! If you like please have a look at/comment/test #3591. |
We have tested our application against the 3.2.0-GH-3590-SNAPSHOT version and everything went fine. Meanwhile, we have implemented a workaround we will use while waiting for the official release. From our repository implementation:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The annotation @Sharded(shardKey = {...}) add some filters to the request performed upon MongoDB when updating a document (upsert).
If we use composite keys like "location.locationId", the value from the Document we store is not retrieved, due to the Document not being "flatted".
This is done in the
applyShardKey
method, in theUpdateContext
inner class within theQueryOperations
class:getMappedShardKeyFields(domainType).forEach(key -> filterWithShardKey.putIfAbsent(key, shardKeySource.get(key)));
See this question on SO.
The text was updated successfully, but these errors were encountered: