When a user interacts with my API by registering or logging in, I want to pre-configure what the fields in the document will look like when inserted into the collection i.e. a password is required for the insertion to be valid.
Also, because I'm building an SPA with server-side rendering, only validation will occur in the client, and sanitisation is handled on the server.
I've run into the issue of the insert not going to the correct database, it creates a default called "test".
Investigate the docs to see why it's behaviour.
When a user interacts with my API by registering or logging in, I want to pre-configure what the fields in the document will look like when inserted into the collection i.e. a password is required for the insertion to be valid.
Also, because I'm building an SPA with server-side rendering, only validation will occur in the client, and sanitisation is handled on the server.