@@ -381,9 +381,9 @@ public static UnwindOperation unwind(String field, String arrayIndex) {
381
381
}
382
382
383
383
/**
384
- * Factory method to create a new {@link UnwindOperation} for the field with the given name, including the name of a new
385
- * field to hold the array index of the element as {@code arrayIndex} using {@code preserveNullAndEmptyArrays}. Note
386
- * that extended unwind is supported in MongoDB version 3.2+.
384
+ * Factory method to create a new {@link UnwindOperation} for the field with the given name, including the name of a
385
+ * new field to hold the array index of the element as {@code arrayIndex} using {@code preserveNullAndEmptyArrays}.
386
+ * Note that extended unwind is supported in MongoDB version 3.2+.
387
387
*
388
388
* @param field must not be {@literal null} or empty.
389
389
* @param arrayIndex must not be {@literal null} or empty.
@@ -428,6 +428,20 @@ public static StartWithBuilder graphLookup(String fromCollection) {
428
428
return GraphLookupOperation .builder ().from (fromCollection );
429
429
}
430
430
431
+ /**
432
+ * Creates a new {@link VectorSearchOperation} by starting from the {@code indexName} to use.
433
+ *
434
+ * @param indexName must not be {@literal null} or empty.
435
+ * @return new instance of {@link VectorSearchOperation.PathContributor}.
436
+ * @since 4.5
437
+ */
438
+ public static VectorSearchOperation .PathContributor vectorSearch (String indexName ) {
439
+
440
+ Assert .hasText (indexName , "Index name must not be null or empty" );
441
+
442
+ return VectorSearchOperation .search (indexName );
443
+ }
444
+
431
445
/**
432
446
* Factory method to create a new {@link SortOperation} for the given {@link Sort}.
433
447
*
@@ -669,14 +683,14 @@ public static LookupOperation lookup(Field from, Field localField, Field foreign
669
683
670
684
/**
671
685
* Entrypoint for creating {@link LookupOperation $lookup} using a fluent builder API.
686
+ *
672
687
* <pre class="code">
673
- * Aggregation.lookup().from("restaurants")
674
- * .localField("restaurant_name")
675
- * .foreignField("name")
676
- * .let(newVariable("orders_drink").forField("drink"))
677
- * .pipeline(match(ctx -> new Document("$expr", new Document("$in", List.of("$$orders_drink", "$beverages")))))
678
- * .as("matches")
688
+ * Aggregation.lookup().from("restaurants").localField("restaurant_name").foreignField("name")
689
+ * .let(newVariable("orders_drink").forField("drink"))
690
+ * .pipeline(match(ctx -> new Document("$expr", new Document("$in", List.of("$$orders_drink", "$beverages")))))
691
+ * .as("matches")
679
692
* </pre>
693
+ *
680
694
* @return new instance of {@link LookupOperationBuilder}.
681
695
* @since 4.1
682
696
*/
0 commit comments