Order by view count in JS library

Hey guys, I'm working on a book application, and want to be able to search books by filter + order i.e. view count. I have a table of all book views, so what I would want is a way to aggregate/count the views by book id.

Any help would be appreciated. Thanks
Was this page helpful?