I
I
Ivan Ivanovich2020-10-10 09:24:50
MongoDB
Ivan Ivanovich, 2020-10-10 09:24:50

How to do mongodb data validation?

Hello.

I am using native mongodb driver. I know that mongoose has a built-in security data validator, but the native driver does not have this (please correct me if I'm wrong).

Can you please tell me how to validate data before writing to the database using native mongodb?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2020-10-10
@IwanQ

For these purposes, you can use JsonSchema
here is an example of using it for validation https://www.newtonsoft.com/json/help/html/JsonSche...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question