48
48
import com .datastax .astra .client .collections .commands .results .FindOneAndReplaceResult ;
49
49
import com .datastax .astra .client .core .options .BaseOptions ;
50
50
import com .datastax .astra .client .core .commands .Command ;
51
- import com .datastax .astra .client .collections .commands .cursor .CollectionCursor ;
51
+ import com .datastax .astra .client .collections .commands .cursor .CollectionFindCursor ;
52
52
import com .datastax .astra .client .core .paging .Page ;
53
53
import com .datastax .astra .client .core .query .Filter ;
54
54
import com .datastax .astra .client .core .query .Filters ;
@@ -994,8 +994,8 @@ public Optional<T> findById(Object id) {
994
994
* @return
995
995
* the find iterable interface
996
996
*/
997
- public CollectionCursor <T , T > find (Filter filter , CollectionFindOptions options ) {
998
- return new CollectionCursor <>(this , filter , options , getDocumentClass ());
997
+ public CollectionFindCursor <T , T > find (Filter filter , CollectionFindOptions options ) {
998
+ return new CollectionFindCursor <>(this , filter , options , getDocumentClass ());
999
999
}
1000
1000
1001
1001
/**
@@ -1010,8 +1010,8 @@ public CollectionCursor<T, T> find(Filter filter, CollectionFindOptions options)
1010
1010
* @return
1011
1011
* the find iterable interface
1012
1012
*/
1013
- public <R > CollectionCursor <T , R > find (Filter filter , CollectionFindOptions options , Class <R > newDocType ) {
1014
- return new CollectionCursor <>(this , filter , options , newDocType );
1013
+ public <R > CollectionFindCursor <T , R > find (Filter filter , CollectionFindOptions options , Class <R > newDocType ) {
1014
+ return new CollectionFindCursor <>(this , filter , options , newDocType );
1015
1015
}
1016
1016
1017
1017
/**
@@ -1022,8 +1022,8 @@ public <R> CollectionCursor<T, R> find(Filter filter, CollectionFindOptions opti
1022
1022
* @return
1023
1023
* the find iterable interface
1024
1024
*/
1025
- public CollectionCursor <T , T > find (Filter filter ) {
1026
- return new CollectionCursor <>(this , filter , new CollectionFindOptions (), getDocumentClass ());
1025
+ public CollectionFindCursor <T , T > find (Filter filter ) {
1026
+ return new CollectionFindCursor <>(this , filter , new CollectionFindOptions (), getDocumentClass ());
1027
1027
}
1028
1028
1029
1029
/**
@@ -1034,8 +1034,8 @@ public CollectionCursor<T, T> find(Filter filter) {
1034
1034
* @return
1035
1035
* the find iterable interface
1036
1036
*/
1037
- public CollectionCursor <T , T > find (CollectionFindOptions options ) {
1038
- return new CollectionCursor <>(this , null , options , getDocumentClass ());
1037
+ public CollectionFindCursor <T , T > find (CollectionFindOptions options ) {
1038
+ return new CollectionFindCursor <>(this , null , options , getDocumentClass ());
1039
1039
}
1040
1040
1041
1041
/**
@@ -1045,9 +1045,9 @@ public CollectionCursor<T, T> find(CollectionFindOptions options) {
1045
1045
* without applying any filters. It leverages the default {@link CollectionFindOptions} for query execution.
1046
1046
* </p>
1047
1047
*
1048
- * @return A {@link CollectionCursor } for iterating over all documents in the collection.
1048
+ * @return A {@link CollectionFindCursor } for iterating over all documents in the collection.
1049
1049
*/
1050
- public CollectionCursor <T , T > findAll () {
1050
+ public CollectionFindCursor <T , T > findAll () {
1051
1051
return find (null , new CollectionFindOptions ());
1052
1052
}
1053
1053
@@ -1129,6 +1129,24 @@ public CompletableFuture<Page<T>> findPageASync(Filter filter, CollectionFindOpt
1129
1129
return CompletableFuture .supplyAsync (() -> findPage (filter , options ));
1130
1130
}
1131
1131
1132
+ // -----------------------------
1133
+ // --- Find and Rerank ----
1134
+ // -----------------------------
1135
+
1136
+ /**
1137
+ * Finds all documents in the collection.
1138
+ *
1139
+ * @param filter
1140
+ * the query filter
1141
+ * @param options
1142
+ * options of find one
1143
+ * @return
1144
+ * the find iterable interface
1145
+ */
1146
+ public CollectionFindCursor <T , T > findAndRerank (Filter filter , CollectionFindOptions options ) {
1147
+ return new CollectionFindCursor <>(this , filter , options , getDocumentClass ());
1148
+ }
1149
+
1132
1150
// -------------------------
1133
1151
// --- distinct ----
1134
1152
// -------------------------
0 commit comments