Techiio-author
Started by Jimmy LittleSep 25, 2021

Open
Sequelize find random records with preference and pagination

0 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 0 VIEWES SHARE

I want to write a query in sequelize in which records will come in a manner where records with some high priority value have chance to (or probability) come ahead and low high priority value have chance to (or probability) come below in random position and in paginated data.

Example :- There are 30 records in a table where 10 records have the priority value of 5 this means 5/30 is the probability of this record to come ahead with random position and in paginated data. i.e every time I hit query this record will have chance to come 5/30 (in every 6 hits probability of coming this record is one).

0 Replies

You must be Logged in to reply
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance