Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

428
Visualizações
What is the best way to save the calendar data in Firestore?

I am building an angular component for handling custom calendars and events. Once an event is created I save the given data to the firestore database as single documents.

Document sample :

 {
  "name" : "test event",
  "description" :"sample test event for check",
  "startdate":"8/12/2021",
  "enddate":"8/12/2021",
  "color":"#11111",
  "userid":"user1"
 }

So on creating each event the similar data structure will be saved as individual documents. We can filter the custom calendar with a date range and also support showing multiple user events in a single calendar.

But using the above document structure, when we try to fetch a large amount of data it leads to higher costing to the server. How can I organize these data on an individual basis or else? Can Anyone suggest your opinion about this?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

This structure should be good for the use case as it won't hit any per document limit (storing events in an array may hit 1 MB per document size limit) and you can easily execute most of the queries.

How can I organize these data on an individual basis or else?

You have the userid field in document and user's events can be filtered using .where("userid", "==", curUserId). Other way would be to use sub-collections:

users -> {userId} -> events -> {eventId}
(col)     (doc)      (col)      (doc)

This way you won't have to store user's UID in every document as it is already grouped in sub-collections.

when we try to fetch a large amount of data it leads to higher costing to the server

Firestore costs are totally based on your usage. If your application has a lots of users then the costs will be higher.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda