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

[BUG] Indexed unique will not work after Field regex. #919

Open
hgalytoby opened this issue Apr 19, 2024 · 1 comment
Open

[BUG] Indexed unique will not work after Field regex. #919

hgalytoby opened this issue Apr 19, 2024 · 1 comment
Labels

Comments

@hgalytoby
Copy link

Describe the bug
Indexed unique will not work after Field regex.

To Reproduce

not work

class RegexTest(Document):
    val: Indexed(str, unique=True) = Field(regex=r"^[a-zA-Z0-9]+$")


await RegexTest(val='123').create()
await RegexTest(val='123').create()

work

class RegexTest(Document):
    val: Indexed(str, unique=True) = Field()


await RegexTest(val='123').create()
await RegexTest(val='123').create()
Copy link

This issue is stale because it has been open 30 days with no activity.

@github-actions github-actions bot added the Stale label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant