[SOLVED] What do you recommend to do a data analysis of a collection? It has a lot of information.
- 1
- Self Hosted
- Databases
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
What kind of analysis?
perform operations with the information of the collections, that is, perform calculations to determine earnings of the day, month, year per user.
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
i would use functions and maybe store incremental data or so in a collection.
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.
I like that approach although I don't know if it would apply with thousands of data?
it depends on what kind of reporting you want.
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
the idea is perfect. My question would be that function. Can I make it run when it detects a change?
yes, you can have functions trigger on an event like document creation or delete
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.
how is this related to your original question?
I understand, I open another question. It's already a nodejs related topic. thank you.
[SOLVED] What do you recommend to do a data analysis of a collection? It has a lot of information.
Recommended threads
- Guideline of AI
Hello everyone, I’m planning to specialize in Artificial Intelligence (AI) and I’m currently looking for guidance from someone with strong experience in the fi...
- Query multi-tenant db with $permissions ...
I'm setting up a multi-tenant database with RLS enabled. My users my have permissions set for multiple Teams, and as such when they query the database with the ...
- Authentication on custom Websocket Serve...
Hi, I want to use a custom Websocket Server (using Bun) for my application. However I cant really figure out authentication on custom servers. Session cookies ...