I'm using mongoose schemas at application level in combination with mongodb. For testing, I want to fill my mongodb with fake data. The library mongoose-faker does not seem to be automatic. I know there are fakers for JSON-Schema, but I don't want to maintain to types of Schemas.
Is it possible to generate fake data automaticaly?
Greetings
Daniel
Edit: I'll try to generate a JSON-Schema from my Mongoose-Schema. I can test this on monday
The Mongoose-Schema can be transformed into an JSON-Schema with the module mongoose-schema-jsonschema. Fake data can be generated with the module json-schema-faker.
It's nice to know, that the transformation can only transform standard mongoose types to JSON-Schema. Also the faker seems to have problems with generating required fields if they are in an array of objects.
But in general this solution works.