mgeneratejs icon indicating copy to clipboard operation
mgeneratejs copied to clipboard

Use case of $pick not clear

Open niccottrell opened this issue 6 years ago • 0 comments

I'm a bit confused by the point of $pick. I have an example like:

"$pick": {
      "array": [
        "75009",
        "75010",
        "75008",
        "75011"
      ]
    }

and had assumed that by default it would pick an element at random, but it always picks element = 0. How can I randomize this and specify a value for element?

I guess I should be using $choose instead - but then I don't understand what the point of $pick is.

niccottrell avatar Nov 30 '18 15:11 niccottrell