-
Notifications
You must be signed in to change notification settings - Fork 15
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
Reactive dict/map between documents #9
Comments
This is useful when there is no need for an order of those related documents. If order is needed/important, then list is required. |
In fact, I still managed to define things with whatever is currently available, so the good question is how much this is really needed. :-) |
I'm interested in your use case for identified related documents with a subset of fields kept sync'd. Can you share your example/general case. Much appreciated. |
I do not understand your question. This ticket is about one particular structure of data and not a general ticket for questions about PeerDB. |
It seems I misunderstood your idea/proposal. I initially thought you were proposing an alternative/extension to the existing ReferenceField capability fieldName: @ReferenceField and was seeking to understand your use case/why it wasn't sufficient... as per README: class Post extends Document
# Other fields:
# body
@Meta
name: 'Post'
fields: =>
# We can reference other document
author: @ReferenceField Person, ['username', 'displayName']
# Or an array of documents
subscribers: [@ReferenceField Person]
reviewers: [@ReferenceField Person, ['username', 'displayName']] |
Yes. Here is a ticket for a different structure than what is currently implemented. But I have not seen really a need for it. I prefer to use list of subdocuments anyway. Also, I do not like data schemas where keys have meaning. So ticket/idea is here, but this is it. |
This can also work only if |
It seems a common data structure one would like is the following:
So a dict/map where keys are IDs and values are a subdocument with few fields of a referenced document. One can do that as a list for now, but I think having a dict/map would be beneficial for easy direct access if key (document id) is known. But current code does not yet support keeping subdocuments in sync for such structure.
The text was updated successfully, but these errors were encountered: