X
X
Xsader2019-06-07 21:37:25
JavaScript
Xsader, 2019-06-07 21:37:25

How to select a random entry in mongodb via mongoose and initialize the value of one of its parameters into a variable?

Let's say we have a base called somebase and a collection called someCollection with a dynamic (changing) number of entries. Records have a parameter with some value (for example, test_number:someNumber. You need to choose a random one from all records and pass the value of its test_number parameter to a variable.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question