Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect _id type for ExtractProps #68

Open
fi6 opened this issue Jan 7, 2021 · 0 comments
Open

Incorrect _id type for ExtractProps #68

fi6 opened this issue Jan 7, 2021 · 0 comments

Comments

@fi6
Copy link

fi6 commented Jan 7, 2021

If type of _id is set to be none-ObjectId type, the ExtractProps will still extract _id as ObjectId.

const AccountSchema = createSchema({
    _id: Type.string({ require: true }),
    nickName: Type.string({ require: true }),
    ggSlug: Type.string({ require: true }),
    ggPlayerId: Type.string({ require: true }),
    gamerTag: Type.string({ require: true }),
    prefix: Type.string(),
});

type AccountProps = ExtractProps<typeof AccountSchema>;

type AccountProps = {
    **_id: Types.ObjectId;**
    nickName?: string | undefined;
    ggSlug?: string | undefined;
    ggPlayerId?: string | undefined;
    gamerTag?: string | undefined;
    prefix?: string | undefined;
    __v: number;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant