victorteokw / seedgoose

Mongoose data seeding with smart id references tracking.
MIT License
24 stars 5 forks source link

Seeding documents through mongoose #17

Open hennessyevan opened 5 years ago

hennessyevan commented 5 years ago

Correct if I'm wrong here but when I'm seeding data, the information that's supposed to run through my mongoose model's methods, plugins, defaults and even native mongoose timestamps don't get created. It seems to me that seedgoose doesn't use mongoose to populate the database.

Based on #8 I imagine that there is some technical limitation that requires going around mongoose for these instance methods and type casting, etc.? From a technical standpoint would it be possible for seedgoose to generate data with smart IDs and then feed mongoose with that? I love the design of this project but I can't see myself using it without type-casting and having to mock the instance methods on my models.

victorteokw commented 5 years ago

Hi @hennessyevan, sometimes if you want to use mongoose to seed data and run save hook, it fails because the whole data map is not complete at the moment it is seeding. How about adding a flag option?