-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Timegraph Extension Buggy #638
Comments
Hi @eddiejibson, If you don't want to retrieve all of your data, you could create index nodes for a specific timerange, such as gun.get('submissions').get('week46').map().once(function). And as items are submitted you create new index nodes for each week. That is the beauty of graphs. you can still put all the data under submissions, but then you can link from another path to that submission to find it again. So if you ever need to list all, you can have gun.get('submissions').get('all') and still retrieve all of them. |
Hi @Dletta. Thanks for your reply. That sounds like a good idea. However, I'm unsure the best way to store the week number as it currently returns the UNIX epoch value - should I convert it somehow? |
@eddiejibson hmm, you might defined it as a range of epoch value converted to string. Or you can just say everything before Midnight of Saturday of a given week get's saved under the epoch time of that Saturday. Does that make sense?
|
timeGraph in time.js just stack over flow……for it saves time-related data in father-son,and when the data is so huge that the recursion would cause a stack-over-flow |
@mccoysc have you had stack overflows with it? |
yes,about 100+ records in a time graph |
@mccoysc Then I would recommend the approach I gave above, essentially indexing your time stamps and splitting them into searchable groups. Time graph is beta and has only been used in limited use cases. |
Is my title update correct? timegraph is a super small extension https://github.com/amark/gun/blob/master/lib/time.js Would anybody be willing to become a maintainer for it? All you need to know is how to save/traverse a custom time radix tree, which sounds fancy, but really isn't. |
@mccoysc could you give us an example of the code you're using and an example piece of data? How is your data structured? For example; Does your data contain nested data? Does your data contain references to parent nodes? |
milano-server-3675b89bc12d494eac33ec6f9ec80f931eedff52.zip Run the following commands: I made a python script to mimic activity coming from sensors. Then... $ cd py-script Stack overflow issue Performance: |
Hello,
I understand that
gun.get()
is used for retrieving data. However, in the case of only wanting to retrieve say the most recent entries meeting the keys specified, I was wondering if this was possible? For example, if I was building a public post system and wanted to display the top 50 most recent submissions, could this be done because getting every single post ever seems very silly? I know other databases allow such actions along with offering operators which allows the user to only get entries if a certain key is greater than a given integer. Is this a feature or could it be for Gun?Thanks.
The text was updated successfully, but these errors were encountered: