|
45 | 45 | import com.google.cloud.firestore.pipeline.stages.Distinct; |
46 | 46 | import com.google.cloud.firestore.pipeline.stages.FindNearest; |
47 | 47 | import com.google.cloud.firestore.pipeline.stages.FindNearestOptions; |
48 | | -import com.google.cloud.firestore.pipeline.stages.Insert; |
49 | 48 | import com.google.cloud.firestore.pipeline.stages.Limit; |
50 | 49 | import com.google.cloud.firestore.pipeline.stages.Offset; |
51 | 50 | import com.google.cloud.firestore.pipeline.stages.PipelineExecuteOptions; |
@@ -1110,95 +1109,8 @@ public Pipeline update(Update update) { |
1110 | 1109 | } |
1111 | 1110 |
|
1112 | 1111 | /** |
1113 | | - * Performs an insert operation using documents from previous stages. |
1114 | | - * |
1115 | | - * <p>The documents must include a valid {@code __name__} field specifying the document reference |
1116 | | - * to insert. If the document already exists, the operation will fail. |
1117 | | - * |
1118 | | - * <p>Example: |
1119 | | - * |
1120 | | - * <pre>{@code |
1121 | | - * Map<String, Object> book = new HashMap<>(); |
1122 | | - * book.put("__name__", firestore.collection("books").document("newBook")); |
1123 | | - * book.put("title", "New Book"); |
1124 | | - * |
1125 | | - * firestore.pipeline() |
1126 | | - * .literals(book) |
1127 | | - * .insert() |
1128 | | - * .execute() |
1129 | | - * .get(); |
1130 | | - * }</pre> |
1131 | | - * |
1132 | | - * @return A new {@code Pipeline} object with this stage appended to the stage list. |
1133 | | - */ |
1134 | | - @BetaApi |
1135 | | - public Pipeline insert() { |
1136 | | - return append(new Insert()); |
1137 | | - } |
1138 | | - |
1139 | | - /** |
1140 | | - * Performs an insert operation using documents from previous stages into a specified target |
1141 | | - * collection. |
1142 | | - * |
1143 | | - * <p>If documents have an ID (or expression evaluation for ID), they will use it. Otherwise, |
1144 | | - * auto-generated IDs will be used if applicable (depending on the source). |
1145 | | - * |
1146 | | - * <p>Example: |
1147 | | - * |
1148 | | - * <pre>{@code |
1149 | | - * CollectionReference backupCol = firestore.collection("books_backup"); |
1150 | | - * |
1151 | | - * Map<String, Object> book = new HashMap<>(); |
1152 | | - * book.put("title", "New Book"); |
1153 | | - * |
1154 | | - * firestore.pipeline() |
1155 | | - * .literals(book) |
1156 | | - * .insert(backupCol) |
1157 | | - * .execute() |
1158 | | - * .get(); |
1159 | | - * }</pre> |
1160 | | - * |
1161 | | - * @param target The collection to insert to. |
1162 | | - * @return A new {@code Pipeline} object with this stage appended to the stage list. |
1163 | | - */ |
1164 | | - @BetaApi |
1165 | | - public Pipeline insert(CollectionReference target) { |
1166 | | - return append(new Insert().withCollection(target)); |
1167 | | - } |
1168 | | - |
1169 | | - /** |
1170 | | - * Performs an insert operation using an {@link Insert} stage. |
1171 | | - * |
1172 | | - * <p>This method allows you to use a pre-configured {@link Insert} stage. |
1173 | | - * |
1174 | | - * <p>Example: Use a pre-configured {@link Insert} stage with a target collection and ID |
1175 | | - * expression, reading from literals. |
1176 | | - * |
1177 | | - * <pre>{@code |
1178 | | - * CollectionReference targetCol = firestore.collection("books_backup"); |
1179 | | - * Insert insertStage = new Insert().withCollection(targetCol).withIdExpression(field("custom_id")); |
1180 | | - * |
1181 | | - * Map<String, Object> book = new HashMap<>(); |
1182 | | - * book.put("custom_id", "book1"); |
1183 | | - * book.put("title", "Book 1"); |
1184 | | - * |
1185 | | - * firestore.pipeline() |
1186 | | - * .literals(book) |
1187 | | - * .insert(insertStage) |
1188 | | - * .execute() |
1189 | | - * .get(); |
1190 | | - * }</pre> |
1191 | | - * |
1192 | | - * @param insertStage The {@code Insert} stage to append. |
1193 | | - * @return A new {@code Pipeline} object with this stage appended to the stage list. |
1194 | | - */ |
1195 | | - @BetaApi |
1196 | | - public Pipeline insert(Insert insertStage) { |
1197 | | - return append(insertStage); |
1198 | | - } |
1199 | | - |
1200 | | - /** |
1201 | | - * Adds a generic stage to the pipeline. |
| 1112 | + * Performs an insert operation using documents from previous stages. Adds a generic stage to the |
| 1113 | + * pipeline. |
1202 | 1114 | * |
1203 | 1115 | * <p>This method provides a flexible way to extend the pipeline's functionality by adding custom |
1204 | 1116 | * stages. Each generic stage is defined by a unique `name` and a set of `params` that control its |
|
0 commit comments