After reading a bunch of threads regarding trying to perform queries on fields with dynamic keys in a document, I have two questions.
- Is it possible to perform the following "query" on my data model: "Get field where createdDate is equal or greater than todays date"?
- Should I change the data model?
I have documents (test.com in the below image) that have fields where the key is dynamic (0, 1, 2, 3 and so on). Each field is a "map", which (correct me if Im wrong) contains an object. Each object have a "createdAt". I want to query all fields on "createdAt" and return all fields where "createdAt" is equal to or greater than todays date. So in my image, as of today it is the 12 of january, the field with the key "1" should be returned.
My query below doesn't work due to I don't "reach down to each field", would each document have just color, createdAt and domainName flattened It would have worked.
const domainsQuery = query(
collectionGroup(db, "domains"),
where("releaseAt", ">=", new Date())
);