我想发送MongoDB文档实体的事件流,直到文档中的某些字段符合我的条件(例如String.equals()
)
例如
MyDocument myDocument;
do {
myDocument = myDocumentService.get(id);
System.out.println(myDocument.toString());
} while(myDocument.getStatus().equalsIgnoreCase("Ready"));
@RequestMapping(produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public Flux<MyDocument> getStatus(@PathVariable int id) {
Mono<MyDocument> myDocument = myDocumentService.get(id);
return Flux.___what_should_I_use_here_?___(data)
}