I'm still relatively new to Firebase and it's been pretty weird to move from that considering my knowledge with SQL.
This is my desired table
Contracts
ID
PlayerID
CompanyID
Status
ExpiryDate
Etc...
In one function, I would like to get all contracts where PlayerID = custom_playerid (to get all contracts of one player)
In another function, I would like to get all contracts where CompanyID = custom_companyid (to get all contracts of one company)
In another function, I would like to get one contract where Status = 0 and CompanyID = custom_companyid (See if there's a 'non-fulfilled' contract in a company)
And in a cron job, I would search for all the contracts where CurrentDate > ExpiryDate and Status = 0 to remove them from the database.
How should I approach this? I've just learned that I couldn't do several orderByChild and that's been making the database a bit more complicated for newbies.
I've considered at some point to make several tables "ContractByCompany", "ContractByPlayer", which would facilitate the task but I would assume it would be a big pain to fix all the tables I currently have to suit that.