I want to share the same schema with both client and server. I guess I can looking into passing in a Schema instance when defining schemas. Of course other options are to drop mongoose and go down a level.
At the moment we use a similar scheme on the client and the server. The only difference is that not all fields are required on the client for the security reason. Turns out, there are two identical files with the scheme, the first is located on the server, the second on client. The server acts as an api to which client-side queries to retrieve data, then these data are converted into a document using the schema on the client.
Now there is no reason to use the storage on the server, because there is a mongoose. And schemes for they have almost the same syntax.
There is currently no transport to transfer the schema from the server to the client, it is necessary to use two files.
You don't have to abandon mongoose, if you want to use the schema on the client.