-
Notifications
You must be signed in to change notification settings - Fork 105
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
Add a '$singleton' option for graph points to keep only the latest single record #467
Comments
|
I've been working on how this would work and have some WIP PRs around it. As discussed with @csuwildcat and I believe suggested by @diehuxx, a "$keep" property that is a positive integer greater than 0 rather than a "$singleton" property to only denote 1 would bring better flexibly. Some thoughts on @diehuxx's questions above: Yes, I think"$keep" records should be able to be nested.Currently when a new record is written the older ones are purged. However the reject path is also interesting, and I could see how that might be useful. Maybe behind a protocol definition property that denotes the behavior of $keep, with default being purge. Maybe something like this:
For anything that is a child of a protocol context, the parentId and contextId are required upon creation of that record, currently I "$keep" the limit number of records within that context. So you could have "foo/bar" with a a "$keep" limit of 5, you would then keep 5 "foo/bar"s for each parent instance of "foo". If you had 5 "foo" records, you would then have a total of 25 "foo/bar" records. Would like to get some input on this. |
@LiranCohen Looks good! We discussed at office hours. I'll summarize:
|
Or maybe just |
@thehenrytsai I think they like |
@csuwildcat, I see, fair, so: |
Could be related to #786. |
Many times a graph point is intended to only have one record stored, never multiple. If we added a '$singleton' boolean option it would allow the dev to specify that an object in the graph was to only have one record, the latest one, kept and all others discarded. Thing of the case of having a blog protocol where you have an
index
html record where you only ever want one, don't really care about the recordId, and just want the latest kept. The $singleton option would make that possible.The text was updated successfully, but these errors were encountered: