repl / Springboot-Scala-MongoDB

1 stars 2 forks source link

Fix total count value returned in book listing endpoint #1

Open repl opened 5 years ago

repl commented 5 years ago

The endpoint /api/v1/books' returns books in a paginated way and each response payload also includes an attribute total count which will help the caller to show the total number of pages. The total count needs to be calculated using mongodb operations using spring data methods.

shivam15 commented 5 years ago

I would like to take this please assign it to me.

repl commented 5 years ago

@shivam15 Thank you for your interest. You will have to add a few records in your local mongodb (see README). Please go ahead and create a PR.

shivam15 commented 5 years ago

@repl can you update readme for deploying scala backend?

repl commented 5 years ago

@shivam15 The service is run using bootRun task of gradle. I have updated the readme as well.

shivam15 commented 5 years ago

@repl created pull request please check.

repl commented 5 years ago

Can you please find the total in one call to mongodb? This is what I was trying to implement.

On Sat, Apr 13, 2019, 3:46 AM Shivam Sarawagi notifications@github.com wrote:

@repl https://github.com/repl created pull request please check.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/repl/Springboot-Scala-MongoDB/issues/1#issuecomment-482798249, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhGypabeQD_J1dFYEA74OoH9w8QmZ2_ks5vgbV1gaJpZM4cdf3z .

shivam15 commented 5 years ago

Do you think its possible since you are passing limit and skip in the first query. How will you get total count in same?

repl commented 5 years ago

Please analyze if any composite aggregate query can be formed.

On Sat, Apr 13, 2019, 8:22 PM Shivam Sarawagi notifications@github.com wrote:

Do you think its possible since you are passing limit and skip in the first query. How will you get total count in same?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/repl/Springboot-Scala-MongoDB/issues/1#issuecomment-482916277, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhGyoHfaoLZwjjlgqJ7zJhUTqSTZ8e8ks5vgp79gaJpZM4cdf3z .