Skip to content

getting a single document instaid of many documents in the collection #164

Answered by pkosiec
khawarizmus asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @gimyboya,
Looks like the problem is in the following line:

export const emails = scaffolding;

Please look into the docs https://github.com/pkosiec/mongo-seeding/blob/master/docs/import-data-definition.md#create-proper-directory-structure:

Without named export it should work fine:

  • In TypeScript files (ts extension), use export = objectOrArray.
    (...)

    Array of objects

    export = [
        {
            name: "Dog"
        },
        {
            name: "Cat"
        }
    ]

Let me know if it works for you. Cheers!

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by pkosiec
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #164 on March 21, 2021 18:58.