Spring Data REST : custom query for MongoDB repository

前端 未结 1 899
甜味超标
甜味超标 2021-01-20 18:52

I am trying to create a custom query from the Spring guide : Accessing MongoDB Data with REST according to the Reference 4.4 Custom Implementations. But my custom method is

1条回答
  •  不思量自难忘°
    2021-01-20 19:37

    This is by design. As soon as you start implementing a repository method manually we cannot know whether GET or POST is the right HTTP method as whether the execution is idempotent depends on how you implement it.

    So the way to go would be implementing a custom controller and expose those methods using the adequate HTTP method. That said, there's a ticket in our tracker to provide means to define the way these methods should be exposed as well.

    0 讨论(0)
提交回复
热议问题