Shuffling an array randomly

I have an array of CDTs say questions with question structured as:

{

id: 1,

statement: "Text string of question",

options: {List of Options}

}

Like multiple values like the above.

I would like to shuffle this array of questions randomly so that every time I print this array the questions are in no particular order and are different from last time. Example if I pick the array first time it had an order:

1, 4, 2, 5, 3

But next time I pick same array it should be ordered randomly like:

3, 5, 1, 4, 2

Also is there any possible way to implement Rand() ordering in the query like we do in SQL?

  Discussion posts and replies are publicly visible