I'm using loopback to build an application, and would like to write a custom remote method which returns a random model instance from the database.
Is there a way to do this using the built-in ORM?
Thanks!
I'm using loopback to build an application, and would like to write a custom remote method which returns a random model instance from the database.
Is there a way to do this using the built-in ORM?
Thanks!
There is no built-in way. You can do it manually depending on the type of data source you're using.
See https://groups.google.com/forum/#!searchin/loopbackjs/random/loopbackjs/C08v1K0NKHk/8nUp9VSGEhEJ