feliixx/mgodatagen

add basic generator type Enum

Closed this issue · 2 comments

It would be great to have an Enum type basic generator:

"fieldName": {
  "type":             "enum",
  "values":        ["Taurus", "Cancer", "Virgo", ..]
}

Hi @visko-sc,

you can use the fromArray generator to achieve this:

"fieldName": {
  "type":             "fromArray",
  "in":        ["Taurus", "Cancer", "Virgo"]
}

see for example: https://mongoplayground.net/p/qwo5JYhOBrR

idc77 commented

I agree though that the term enum is more recognizable and standardized than fromArray, maybe enum could become an alias of fromArray