Skip to content
Advertisement

ReactiveMongoRepository can’t save to database

I’m newbie with Java. I’m create an API with Webflux and ReactiveMongoRepository. I try to save my data from another API.

My repository:

JavaScript

My service implements:

JavaScript

My services:

JavaScript

My model:

JavaScript

After function findByIdAccountsApiTrack() run I can’t find any document created in my database. I can see my variable accountApiTracking have data. But accountApiTrackingRepo.save doesn’t work. What I’m missing?

Advertisement

Answer

In Reactive programming should subscribe to any reactive instruction. you should return accountApiTrackingRepo.save(accountApiTracking); to till your usage for example in the controller. or for your test case, you can use “.subscribe()” after your method call.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement