File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
source/includes/data-formats Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 55
66import com .mongodb .client .model .CreateCollectionOptions ;
77import com .mongodb .client .model .TimeSeriesOptions ;
8+ import com .mongodb .client .result .InsertManyResult ;
89import com .mongodb .reactivestreams .client .*;
910import org .bson .Document ;
1011import reactor .core .publisher .Flux ;
@@ -54,7 +55,9 @@ public static void main(String[] args) {
5455 .append ("location" , "New York City" )
5556 .append ("timestamp" , new Date (1727841600000L ));
5657
57- collection .insertMany (Arrays .asList (temperature1 , temperature2 ));
58+ Publisher <InsertManyResult > insertPublisher =
59+ collection .insertMany (Arrays .asList (temperature1 , temperature2 ));
60+ Mono .from (insertPublisher ).block ();
5861 // end-insert-time-series-data
5962 }
6063 }
You can’t perform that action at this time.
0 commit comments