How to model data for sales per month?

Hi there,

I am still exploring the basic possibilities of fauna and try to find the “best”/new ways to handle data (indexes and/or Lambda).

My example:

  • One collection goods containing documents with name (apples, oranges)
  • One index “all_goods_by_name” forcing a unique name for goods
  • One collection sales
    Year, Month, reference to goods (i.e. apples), number of sales

Tasks:

  • Create/update sales document for each month and goods if it does not exist/update sales if it exists
  • Get sales by goods in timeframe “x”

Would you add more indexes to filter/handle the sales collection documents or is there a better approach? Restructuring data and/or using Lambda?

Thanks in advance