File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
examples/src/main/java/com/datastax/astra/docs Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change 30
30
31
31
import static com .datastax .astra .client .core .query .Projection .include ;
32
32
import static com .datastax .astra .client .tables .commands .options .CreateIndexOptions .IF_NOT_EXISTS ;
33
+ import static com .datastax .astra .internal .serdes .tables .RowMapper .mapAsRow ;
33
34
34
35
public class UpdateOneExample2 {
35
36
@@ -60,18 +61,13 @@ public static void main(String[] args) throws Exception {
60
61
* But here we need to override 'summaryGenresVector' with
61
62
* a String to use the "Vectorize" feature of Astra.
62
63
*/
63
- List <Row > rows = books .stream ().map (book -> {
64
- Row row = RowMapper .mapAsRow (book );
65
- // Override 'summaryGenresVector' with a String
66
- row .put ("summaryGenresVector" , String .format (
64
+ List <Row > rows = books .stream ().map (book ->
65
+ mapAsRow (book ).put ("summaryGenresVector" , String .format (
67
66
"summary: %s | genres: %s" , book .getSummary (),
68
- String .join (", " , book .getGenres ())));
69
- return row ;
70
- }).toList ();
67
+ String .join (", " , book .getGenres ())))).toList ();
71
68
database .getTable ("quickstart_table" ).insertMany (rows );
72
69
73
-
74
- // Next Seach Table
70
+ // Next Search Table
75
71
76
72
}
77
73
You can’t perform that action at this time.
0 commit comments