A
A
Artem Prokhorov2021-11-28 19:17:24
MongoDB
Artem Prokhorov, 2021-11-28 19:17:24

How to specify min/max length for string in rules?

How to specify min/max length for string in rules?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nowm, 2021-11-28
@kotcich

In MongoDB, as far as I know, there are no such limits. Limits apply only to the final size of the entire document after converting to BSON (16 megabytes). So, if you want to put in some limits, like a maximum username length of 20 characters, you'll have to trim the strings to the desired length yourself somewhere in the code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question