You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
export declare type Projection<TSchema> = Partial<Record<Join<NestedPaths<WithId<TSchema>>, '.'>, number>>;
These types have a Record with values as numbers. I believe that it would be enough changing those Records, but I would like to get the community knowledge here.
Thanks!
The text was updated successfully, but these errors were encountered:
Hey! MongoDB allows doing projections with operators in find queries (https://www.mongodb.com/docs/v6.0/reference/operator/projection/)
Example
Considering the following schema:
And having the following info stored:
The following query:
should output the following data:
Current issue
The current version force you to set a number in the projection field and doesn't allow you to include projection operators.
Probably we only need to change the following types:
export declare type ProjectionType<TSchema extends BaseSchema, Projection extends Partial<Record<Join<NestedPaths<WithId<TSchema>>, '.'>, number>> | undefined> = undefined extends Projection ? WithId<TSchema> : WithId<DeepPick<TSchema, '_id' | (keyof Projection & string)>>;
export declare type Projection<TSchema> = Partial<Record<Join<NestedPaths<WithId<TSchema>>, '.'>, number>>;
These types have a Record with values as numbers. I believe that it would be enough changing those Records, but I would like to get the community knowledge here.
Thanks!
The text was updated successfully, but these errors were encountered: