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 5
5
6
6
import com .mongodb .client .model .CreateCollectionOptions ;
7
7
import com .mongodb .client .model .TimeSeriesOptions ;
8
+ import com .mongodb .client .result .InsertManyResult ;
8
9
import com .mongodb .reactivestreams .client .*;
9
10
import org .bson .Document ;
10
11
import reactor .core .publisher .Flux ;
@@ -54,7 +55,9 @@ public static void main(String[] args) {
54
55
.append ("location" , "New York City" )
55
56
.append ("timestamp" , new Date (1727841600000L ));
56
57
57
- collection .insertMany (Arrays .asList (temperature1 , temperature2 ));
58
+ Publisher <InsertManyResult > insertPublisher =
59
+ collection .insertMany (Arrays .asList (temperature1 , temperature2 ));
60
+ Mono .from (insertPublisher ).block ();
58
61
// end-insert-time-series-data
59
62
}
60
63
}
You can’t perform that action at this time.
0 commit comments