Skip to content

Generating fake data for mongoose 'ref' attributes #2287

Closed Answered by Shinigami92
faaiz99 asked this question in Q&A
Discussion options

You must be logged in to vote

You are already on the right path, but should have a look into our docs https://fakerjs.dev/guide/usage.html#create-complex-objects

Also I can recommend to use let tags = faker.helpers.arrayElement(tag);, because that way you rely on Faker's seed value and get deterministic results.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@faaiz99
Comment options

Answer selected by faaiz99
Comment options

You must be logged in to vote
1 reply
@faaiz99
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
3 participants
Converted from issue

This discussion was converted from issue #2286 on August 01, 2023 06:35.