This works well:
const posts = yield* repo.query(Query.where('status', '==', 'published'));
However, this does not:
const posts = yield* repo.query(Query.where('metaData.type', '==', 'post'));
I use this type utils for inferring keys with dot notation, which I think can be useful here (instead of type FieldKeys<S> in query.ts):
type DotPrefix<T extends string> = T extends "" ? "" : `.${T}`
export type NestedFieldKeys<T> = (
T extends object ?
{ [K in Exclude<keyof T, symbol>]: `${K}${DotPrefix<NestedFieldKeys<T[K]>>}` }[Exclude<keyof T, symbol>]
: "") extends infer D ? Extract<D, string> : never;
type Form = {
a: { b: string, c: number }
}
type FormKeys = NestedFieldKeys<Form> // will be 'a.b' | 'a.c'
This works well:
However, this does not:
I use this type utils for inferring keys with dot notation, which I think can be useful here (instead of type
FieldKeys<S>in query.ts):