Posting data and counting how much data

Hello, I am creating a bidding platform, and would like to know how to do one thing, it all works when a user bids, it registers it successfully, what I want now, is to register aswell the user id and the bidding ammount, that data I can pull it easilly, I don’t know how to store it in a way that all users that bid gets stored.
So like:
userid:bidammounmt
1:200
2:220
5:240
etc

Also, i would like to know what type of field to do so that I don’t have to copy and repost again, but just to add the bid to the field. (each product has its bidding fields and data)

and I want another field to count how many entries are there.

Anyone has any idea how to do that?

This topic has been created from a Discord post (1260911227304022107) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

Something like that, but maybe can be done in another way?

Also I would like the hits count automatically how many bids are there

Just create Bids collection type, and add relation to user, product and value

Then use connect to add bids relation to product

And you will have a proper api so you can do something like:
strapi.db.query('api::bid.bid').count({where: { product: productId l } })
To get count of bids

and inside the each product isn’t it possible?

to have control easily of each product

This way it’s fragile, if you use strapi transfer it would break, not to say you can overflow text fileds, if you want that this way you have to use json fields, but filtering is impossible on that (same as on text field)

You would not be able to filter on userId or productId