Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding subdocuments while seeding data #22

Open
gshubham opened this issue Dec 5, 2014 · 0 comments
Open

Adding subdocuments while seeding data #22

gshubham opened this issue Dec 5, 2014 · 0 comments

Comments

@gshubham
Copy link

gshubham commented Dec 5, 2014

I'm trying to add seed data using mongo-migrate. The problem I'm running into is that I want to add a subdocument as defined here. Subdocuments also have an _id field, but I'm not sure how to make that work. For example, I have a TimelineItem model which has a notes subdocument (which comes from noteSchema), but the only way I can add a new document to the timelineitems collection (and kind of emulating a subdocument) is to say timelineitems.insert({notes: [{//first note}, {//second note}]) but I don't think that captures the structure of the subdocument (like it doesn't have an _id etc.).

How should I make this work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant