You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "aelmaarouf (via GitHub)" <gi...@apache.org> on 2023/06/17 20:10:46 UTC
[GitHub] [beam] aelmaarouf commented on pull request #14927: [BEAM-12400] MongoDBIO support for update within documents
aelmaarouf commented on PR #14927:
URL: https://github.com/apache/beam/pull/14927#issuecomment-1595848890
Hello,
I'm sorry to bring up this old discussion but it's the only thing i found so far (i can create an issue if you prefer).
I have a hard time to understand the difference between *withFindKey* and *withUpdateKey* can anyone please explain it to me ?
Here is my issue : I have a Mongo document like this
```
{
"_id" : objectId,
"patientId" : "u-u-id",
"therapyDate" : 1283839993, // timestamp
"value": x
}
```
I know that the combination (patientId and therapyDate) is unique so i am using the following update configuration :
```
.withFindKey("patientId")
.withFindKey("therapyDate")
.withUpdateFields( UpdateField.fieldUpdate("$set","value", "value"))
```
Using this configuration a new document is created instead of updating the existing one. Can you point me to the proper direction to update this kind of documents (not depending on the _id as updatekey) ?
thanks in advance
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org