You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Datagen doesn’t yet support fields that are lists. I want do to a thing where each order has a list of item ids, then have the item list be the parent field and items.id be the child field.
As a stopgap, I suppose I could make orders an append-only stream with individual item ids instead of a list. I would limit the key space of the order ids to get several items per order. Then I can group by order id and aggregate the item ids into a list
Describe the solution you'd like
I think we would add a case to the record generation function to handle Array type (currently only handles Object and primitive types). There should be one faker method inside the list, and then we generate a random number of elements where the values are generated from the faker method.
For relationships, if the parent field is a list, we would iterate over the list to generate the child records.
The text was updated successfully, but these errors were encountered:
The Faker API has a method called helpers.uniqueArray which can take a function as an input and use that function to generate an array of unique elements. This would be helpful, for example, creating an array of fake product names or ids.
Is your feature request related to a problem? Please describe.
Datagen doesn’t yet support fields that are lists. I want do to a thing where each order has a list of item ids, then have the item list be the parent field and items.id be the child field.
As a stopgap, I suppose I could make orders an append-only stream with individual item ids instead of a list. I would limit the key space of the order ids to get several items per order. Then I can group by order id and aggregate the item ids into a list
Describe the solution you'd like
I think we would add a case to the record generation function to handle Array type (currently only handles Object and primitive types). There should be one faker method inside the list, and then we generate a random number of elements where the values are generated from the faker method.
For relationships, if the parent field is a list, we would iterate over the list to generate the child records.
The text was updated successfully, but these errors were encountered: