question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create a way to enable random ordering

See original GitHub issue

Cosmos Db SQL API has RAND() function. But there is no way to order by this random after obtaining IQueryable<T>.

Suggestion: create [Rand] attribute.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
baynezycommented, Dec 19, 2022

@amastaneh the only solution we could come up with was to store the relevant metadata we wanted to query on in SQL Server in addition to the documents in Cosmos.

We then execute our queries against SQL Server. This returns a record set of primary keys in Cosmos in the correct order. We then get those from Cosmos and return them to the client.

Not ideal, but it works.

1reaction
timsander1commented, Feb 16, 2021

Hi @petro2050. This is on our long-term roadmap but not planned in the upcoming 6 months.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Excel How To Sort a List in Random Order - YouTube
This will help you to quickly organise your data and make it easier to ... In this video, we'll show you how to...
Read more >
Random sort in Excel: shuffle cells, rows and columns
The tutorial will teach you two quick ways to randomize in Excel: perform random sort with formulas and shuffle data by using a...
Read more >
List Randomizer: Shuffle List Items in a Random Order
Randomize your list with our List Randomizer tool! Shuffle custom items, names, or anything else for a fully randomized order. Try it now!...
Read more >
Is there a way to create a random order for functions ...
Basically what I want to do is: I have a series of functions, and I want the program to create a random sequence...
Read more >
sql - Random order set to certain date
If you use RAND() for your random ordering, you can use the date as a seed. Then the sequence of random numbers will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found