leonard-IMBERT / StarlightMap

This is an interactive map for the role play forum isle of starlight
http://hexagrid.xyz
MIT License
0 stars 2 forks source link

Rework the database scheme #3

Open leonard-IMBERT opened 6 years ago

leonard-IMBERT commented 6 years ago

I've created this issue so we can more easily talk about a new scheme for the mongodb database

KingMarth commented 6 years ago

So, from some testing, the fact that each scrape from the page is stored as one big document means that we can't use any query methods on the data we get back; if you want to search through survivors like you do to find survivors on a given hex, then you need to do the filtering yourself.

The plus side to the current approach is that you don't need to worry about 'updating' individual survivors, since each snapshot is entirely separate. I don't see a good way to have this as well as database-level filtering, so it's probably safest to leave the one-record-per-scrape structure in place. Collapsing each race group into one 'survivors' field still seems like a good idea, at least as long as the Description field already identifies character race.