Provides support to increase developer productivity in Java when using MongoDB. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
So if we have debug logging turned on, it looked like perhaps the [expensive] count query is being done twice, but really it only happens once. I'd suggest changing or removing the debug statement on line 1153 in favor of 1172.
As it is today, the output (with debug turned on of course) looks like this, though count is only executed once:
I was noticing that the exact same debug statement is duplicated in https://github.com/spring-projects/spring-data-mongodb/blob/main/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoTemplate.java#L1153
and on the underlying method call at https://github.com/spring-projects/spring-data-mongodb/blob/main/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoTemplate.java#L1172
So if we have debug logging turned on, it looked like perhaps the [expensive] count query is being done twice, but really it only happens once. I'd suggest changing or removing the debug statement on line 1153 in favor of 1172.
As it is today, the output (with debug turned on of course) looks like this, though count is only executed once: