Back

[SOLVED] What do you recommend to do a data analysis of a collection? It has a lot of information.

  • 1
  • Self Hosted
  • Databases
MH7
27 Jul, 2023, 04:28

Hi, I need to do an analysis of an entire collection by user, what would be the best way to address the problem

thank you

TL;DR
User is asking for recommendations on how to perform data analysis on a collection with a lot of information using Node.js. Some suggestions are given, including using functions to trigger on events like document creation or deletion, having a collection of daily earnings and updating documents when earnings change, and storing incremental data. The user also mentions the need to perform calculations on the collection to determine earnings per user. The solution suggested is to use functions and perform calculations with the data in the collection.
Drake
27 Jul, 2023, 04:50

What kind of analysis?

MH7
27 Jul, 2023, 13:19

perform operations with the information of the collections, that is, perform calculations to determine earnings of the day, month, year per user.

D5
27 Jul, 2023, 17:10

I do that by updating it when a new income (for example) comes, so you have a total earnings field and you update it by + the new earnings. This is done with a function to prevent data manipulation

Drake
27 Jul, 2023, 18:12

i would use functions and maybe store incremental data or so in a collection.

MH7
27 Jul, 2023, 19:27

The detail is that if a number changes, a calculation process must be done for all the information of that user. I don't know if that concept that you think works or there may be some other approach.

MH7
27 Jul, 2023, 19:29

I like that approach although I don't know if it would apply with thousands of data?

Drake
27 Jul, 2023, 19:31

it depends on what kind of reporting you want.

Drake
27 Jul, 2023, 19:32

for this use case, i would have a collection of daily earnings where each document is the earnings of a user for a day. i'd have a function that updates that document when earning changes for a particular day. then, you can generate a report using the documents in that collection

MH7
27 Jul, 2023, 20:42

the idea is perfect. My question would be that function. Can I make it run when it detects a change?

Drake
27 Jul, 2023, 21:18

yes, you can have functions trigger on an event like document creation or delete

MH7
27 Jul, 2023, 21:26

OK. He asks how I can obtain the information of a user in nodejs (this is already executed on the server side) since I need a session type to act with his user.

Drake
27 Jul, 2023, 21:28

how is this related to your original question?

MH7
27 Jul, 2023, 21:53

I understand, I open another question. It's already a nodejs related topic. thank you.

D5
27 Jul, 2023, 22:33

[SOLVED] What do you recommend to do a data analysis of a collection? It has a lot of information.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more