Skip to content
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

Cannot update a stored document that uses $ in the field names #2196

Closed
carolynvs opened this issue Jun 24, 2022 · 1 comment · Fixed by #2200
Closed

Cannot update a stored document that uses $ in the field names #2196

carolynvs opened this issue Jun 24, 2022 · 1 comment · Fixed by #2200
Labels
bug Oops, sorry!
Milestone

Comments

@carolynvs
Copy link
Member

I just tried to call store.Update and pass in a document that has a bundle definition. Bundles have some wonky fields like $comment and $id (from json schema) and I'm learning that while you can insert those documents into mongo, you cannot update those documents.

https://www.mongodb.com/docs/manual/core/dot-dollar-considerations/#std-label-crud-concepts-dot-dollar-considerations

Mongodb considers fields with $ prefixes to be instructions, not just field names.

We have a couple options:

  • Customize the serialization of bundles to not use the $ so that we have the full/complete bundle definition
  • Decide we don't care about id and comment when storing the bundle definition (that may not work though)
  • Change the bundle field in the database to another type, and store the bundle as canonical json.

I'm going to try the third option and see if we can unobtrusively make this change before beta.1

@carolynvs carolynvs added the bug Oops, sorry! label Jun 24, 2022
@carolynvs carolynvs added this to the 1.0 milestone Jun 24, 2022
@github-actions
Copy link

Closed by #2200.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Oops, sorry!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant