Meteor-Community-Packages / ground-db

GroundDB is a thin layer providing Meteor offline database and methods
https://atmospherejs.com/ground/db
MIT License
569 stars 76 forks source link

Subscriptions #83

Open doubletaketech opened 9 years ago

doubletaketech commented 9 years ago

How does GroundDB work with Subscriptions? I have subscriptions that don't load all the data in a collection. They load a subset of filtered results.

If I Ground this collection, will it download ALL the documents in the collection? Or just what the subscriptions are asking for?

Thanks, Don

isAlmogK commented 9 years ago

If I'm correct it "grounds" the entire collection

doubletaketech commented 9 years ago

Thats what it looks like. Major showstopper for me. I have too much data in my collections to ground it all. I need subscription-grounding :)

Based on my testing Ground crashes the app on client startup when you have a lot of data. Load app in browser. Close Browser. Re-open app. Crash. I remove GroundDB and ground calls, and the app is fine.

I need a solution for a mobile web app to run offline even and persist data even if the user closes the browser and re-opens the app. It must support grounding only the filtered collection data I have in my subs.

Thanks, Don

malhal commented 9 years ago

I just tested this and I added a filter on the subscription find and then looked in the browser's localStorage and it only had the matching records in there. I could have misunderstood what was being asked but it looks to me that only the filtered subscription is being grounded and not the entire collection.

raix commented 9 years ago

@malhal ground db respects the data publication - thats the main issue when using iron router.

comigor commented 9 years ago

@raix Is it possible to grounddb to keep adding entries to the grounded collection as the user navigates to other routes? (without erasing the old entries or publishing the whole collection)

Eg: Collection with players.

  1. Grounded data is empty
  2. User navigates to /top10 (where only top 10 players are published)
  3. Grounded data has 10 records
  4. User navigates to /bottom10 (where only bottom 10 players are published)
  5. Grounded data has 20 records (top 10 and bottom 10)

Edit: ok, now I see GroundMeteor/subscriptions is the way. :stuck_out_tongue: