Skip to content

Commit 5b3a084

Browse files
docs(documentdb): update descriptions (#15)
* docs(documentdb): update descriptions * Apply suggestions from code review Co-authored-by: Will Russell <will@wrussell.co.uk> --------- Co-authored-by: Will Russell <will@wrussell.co.uk>
1 parent c57964d commit 5b3a084

File tree

5 files changed

+61
-60
lines changed

5 files changed

+61
-60
lines changed

src/main/java/io/kestra/plugin/documentdb/AbstractDocumentDBTask.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,36 +22,36 @@
2222
public abstract class AbstractDocumentDBTask extends Task {
2323

2424
@Schema(
25-
title = "DocumentDB host",
26-
description = "The HTTP endpoint URL of your DocumentDB instance"
25+
title = "DocumentDB endpoint",
26+
description = "Base HTTPS endpoint for the DocumentDB REST API; trailing slash is trimmed before calling `/data/v1/action/*`."
2727
)
2828
@NotNull
2929
protected Property<String> host;
3030

3131
@Schema(
32-
title = "Database name",
33-
description = "The name of the database"
32+
title = "Target database",
33+
description = "Database name used for the operation; expressions are rendered at runtime."
3434
)
3535
@NotNull
3636
protected Property<String> database;
3737

3838
@Schema(
39-
title = "Collection name",
40-
description = "The name of the collection"
39+
title = "Target collection",
40+
description = "Collection inside the database where the action is performed."
4141
)
4242
@NotNull
4343
protected Property<String> collection;
4444

4545
@Schema(
46-
title = "Username",
47-
description = "DocumentDB username for authentication"
46+
title = "HTTP username",
47+
description = "Basic-auth username for the DocumentDB API; prefer providing via secret."
4848
)
4949
@NotNull
5050
protected Property<String> username;
5151

5252
@Schema(
53-
title = "Password",
54-
description = "DocumentDB password for authentication"
53+
title = "HTTP password",
54+
description = "Basic-auth password for the DocumentDB API; prefer providing via secret."
5555
)
5656
@NotNull
5757
protected Property<String> password;

src/main/java/io/kestra/plugin/documentdb/Delete.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
@Getter
2727
@NoArgsConstructor
2828
@Schema(
29-
title = "Delete documents from a DocumentDB collection.",
30-
description = "Delete one or more documents from a DocumentDB collection that match the filter criteria."
29+
title = "Delete documents from DocumentDB",
30+
description = "Remove one document (default) or every match when `deleteMany` is true. An empty filter with `deleteMany` can wipe the collection, so set filters carefully."
3131
)
3232
@Plugin(
3333
examples = {
@@ -101,14 +101,14 @@
101101
public class Delete extends AbstractDocumentDBTask implements RunnableTask<Delete.Output> {
102102

103103
@Schema(
104-
title = "Filter criteria",
105-
description = "MongoDB-style filter to select which documents to delete. Example: {\"status\": \"inactive\", \"age\": {\"$gte\": 18}}"
104+
title = "Filter query",
105+
description = "MongoDB-style filter that selects documents to delete. Rendered at runtime; an empty filter with `deleteMany` deletes every document. Example: `{\\\"status\\\": \\\"inactive\\\", \\\"age\\\": {\\\"$gte\\\": 18}}`"
106106
)
107107
private Property<Map<String, Object>> filter;
108108

109109
@Schema(
110-
title = "Delete multiple documents",
111-
description = "If true, deletes all documents matching the filter (deleteMany). If false, deletes only the first match (deleteOne)."
110+
title = "Delete all matches",
111+
description = "Set to true to delete every document matching the filter; default false deletes only the first match."
112112
)
113113
@Builder.Default
114114
private Property<Boolean> deleteMany = Property.ofValue(false);
@@ -161,9 +161,9 @@ public Output run(RunContext runContext) throws Exception {
161161
@Getter
162162
public static class Output implements io.kestra.core.models.tasks.Output {
163163
@Schema(
164-
title = "Number of documents deleted",
165-
description = "Total count of documents that were successfully deleted"
164+
title = "Deleted document count",
165+
description = "Total number of documents removed by the operation."
166166
)
167167
private final Integer deletedCount;
168168
}
169-
}
169+
}

src/main/java/io/kestra/plugin/documentdb/Insert.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
@Getter
3131
@NoArgsConstructor
3232
@Schema(
33-
title = "Insert documents into a DocumentDB collection.",
34-
description = "Insert one or more documents into a DocumentDB collection. Can insert a single document or multiple documents (max 10) in one operation."
33+
title = "Insert documents into DocumentDB",
34+
description = "Write one document or a batch (max 10) to the target collection. Rendered inputs support expressions; choose either `document` or `documents`."
3535
)
3636
@Plugin(
3737
examples = {
@@ -122,14 +122,14 @@
122122
public class Insert extends AbstractDocumentDBTask implements RunnableTask<Insert.Output> {
123123

124124
@Schema(
125-
title = "Document for single insert",
126-
description = "Document to insert (for single document insertion). Use this OR `documents`, not both."
125+
title = "Single document payload",
126+
description = "Document to insert when sending one record. Mutually exclusive with `documents`; values are rendered before execution."
127127
)
128128
private Property<Map<String, Object>> document;
129129

130130
@Schema(
131-
title = "Multiple documents",
132-
description = "List of documents to insert (max " + MAX_DOCUMENTS_PER_INSERT + "). Use this OR `document`, not both."
131+
title = "Batch documents",
132+
description = "List of documents to insert (max " + MAX_DOCUMENTS_PER_INSERT + "). Mutually exclusive with `document`; order is preserved."
133133
)
134134
private Property<List<Map<String, Object>>> documents;
135135

@@ -194,21 +194,21 @@ public Output run(RunContext runContext) throws Exception {
194194
@Getter
195195
public static class Output implements io.kestra.core.models.tasks.Output {
196196
@Schema(
197-
title = "Inserted document ID",
198-
description = "The ID of the first inserted document (for single insert or first of multiple)"
197+
title = "First inserted ID",
198+
description = "ID of the single document or the first item in a batch; null if none returned."
199199
)
200200
private final String insertedId;
201201

202202
@Schema(
203-
title = "All inserted document IDs",
204-
description = "List of all inserted document IDs"
203+
title = "Inserted document IDs",
204+
description = "List of all document IDs acknowledged by DocumentDB."
205205
)
206206
private final List<String> insertedIds;
207207

208208
@Schema(
209-
title = "Number of documents inserted",
210-
description = "Total count of documents successfully inserted"
209+
title = "Inserted document count",
210+
description = "Total number of documents the API reports as inserted."
211211
)
212212
private final Integer insertedCount;
213213
}
214-
}
214+
}

src/main/java/io/kestra/plugin/documentdb/Read.java

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
@Getter
3737
@NoArgsConstructor
3838
@Schema(
39-
title = "Read documents from a DocumentDB collection.",
40-
description = "Read documents from a DocumentDB collection with optional filtering, limiting, and aggregation support."
39+
title = "Read documents from DocumentDB",
40+
description = "Query a collection with an optional filter, skip/limit, or aggregation pipeline. Results are rendered into the selected `fetchType` output; default FETCH returns all rows."
4141
)
4242
@Plugin(
4343
examples = {
@@ -135,31 +135,31 @@ public class Read extends AbstractDocumentDBTask implements RunnableTask<Read.Ou
135135

136136
@Schema(
137137
title = "Filter",
138-
description = "MongoDB-style filter criteria to apply to the query. Example: {\"status\": \"active\", \"age\": {\"$gte\": 18}}"
138+
description = "MongoDB-style filter for the find query, rendered at runtime. Leave empty to scan the full collection."
139139
)
140140
private Property<Map<String, Object>> filter;
141141

142142
@Schema(
143143
title = "Aggregation pipeline",
144-
description = "MongoDB aggregation pipeline stages. If provided, this will execute an aggregation instead of a simple find."
144+
description = "MongoDB aggregation stages to run instead of a simple find. Overrides `filter`, `skip`, and `limit`."
145145
)
146146
private Property<List<Map<String, Object>>> aggregationPipeline;
147147

148148
@Schema(
149149
title = "Limit",
150-
description = "Maximum number of documents to return"
150+
description = "Maximum number of documents to return; optional server-side cap."
151151
)
152152
private Property<Integer> limit;
153153

154154
@Schema(
155155
title = "Skip",
156-
description = "Number of documents to skip"
156+
description = "Number of documents to skip before returning results."
157157
)
158158
private Property<Integer> skip;
159159

160160
@Schema(
161161
title = "Fetch type",
162-
description = "How to handle query results. STORE: store all rows to a file, FETCH: output all rows as output variable, FETCH_ONE: output the first row, NONE: do nothing"
162+
description = "Controls result handling (default FETCH). STORE writes all rows to Kestra internal storage as Ion, FETCH outputs all rows, FETCH_ONE outputs only the first row, NONE skips output."
163163
)
164164
@NotNull
165165
@Builder.Default
@@ -285,26 +285,27 @@ private static class StoredResult {
285285
@Getter
286286
public static class Output implements io.kestra.core.models.tasks.Output {
287287
@Schema(
288-
title = "Map containing the first row of fetched data",
289-
description = "Only populated if fetchType is FETCH_ONE."
288+
title = "First row",
289+
description = "First matching document when fetchType is FETCH_ONE; null if no results."
290290
)
291291
private final Map<String, Object> row;
292292

293293
@Schema(
294-
title = "List of map containing rows of fetched data",
295-
description = "Only populated if fetchType is FETCH."
294+
title = "Rows",
295+
description = "All returned documents when fetchType is FETCH."
296296
)
297297
private final List<Map<String, Object>> rows;
298298

299299
@Schema(
300-
title = "The URI of the result file on Kestra's internal storage (.ion file / Amazon Ion formatted text file)",
301-
description = "Only populated if fetchType is STORE."
300+
title = "Result file URI",
301+
description = "URI in Kestra internal storage for the Ion result file; only set when fetchType is STORE."
302302
)
303303
private final URI uri;
304304

305305
@Schema(
306-
title = "The number of documents returned by the operation"
306+
title = "Returned document count",
307+
description = "Number of documents fetched or stored."
307308
)
308309
private final Long size;
309310
}
310-
}
311+
}

src/main/java/io/kestra/plugin/documentdb/Update.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
@Getter
2727
@NoArgsConstructor
2828
@Schema(
29-
title = "Update documents in a DocumentDB collection.",
30-
description = "Update one or more documents in a DocumentDB collection that match the filter criteria."
29+
title = "Update documents in DocumentDB",
30+
description = "Apply Mongo-style update operators to matching documents. Defaults to updating one document; set `updateMany` to true to affect all matches. An empty filter with `updateMany` can update every document."
3131
)
3232
@Plugin(
3333
examples = {
@@ -111,21 +111,21 @@
111111
public class Update extends AbstractDocumentDBTask implements RunnableTask<Update.Output> {
112112

113113
@Schema(
114-
title = "Filter criteria",
115-
description = "MongoDB-style filter to select which documents to update. Example: {\"status\": \"pending\", \"age\": {\"$gte\": 18}}"
114+
title = "Filter query",
115+
description = "MongoDB-style filter that selects documents to update. Rendered at runtime; an empty filter with `updateMany` updates all documents."
116116
)
117117
private Property<Map<String, Object>> filter;
118118

119119
@Schema(
120120
title = "Update operations",
121-
description = "MongoDB-style update operations to apply. Example: {\"$set\": {\"status\": \"active\"}, \"$inc\": {\"count\": 1}}"
121+
description = "Required MongoDB update document (e.g., `$set`, `$inc`), rendered before sending to the API."
122122
)
123123
@NotNull
124124
private Property<Map<String, Object>> update;
125125

126126
@Schema(
127-
title = "Update multiple documents",
128-
description = "If true, updates all documents matching the filter (updateMany). If false, updates only the first match (updateOne)."
127+
title = "Update all matches",
128+
description = "Set to true to update every document matching the filter; default false updates only the first match."
129129
)
130130
@Builder.Default
131131
private Property<Boolean> updateMany = Property.ofValue(false);
@@ -188,21 +188,21 @@ public Output run(RunContext runContext) throws Exception {
188188
@Getter
189189
public static class Output implements io.kestra.core.models.tasks.Output {
190190
@Schema(
191-
title = "Number of documents matched",
192-
description = "Total count of documents that matched the filter criteria"
191+
title = "Matched document count",
192+
description = "Number of documents that matched the filter."
193193
)
194194
private final Integer matchedCount;
195195

196196
@Schema(
197-
title = "Number of documents modified",
198-
description = "Total count of documents that were actually modified"
197+
title = "Modified document count",
198+
description = "Number of documents actually updated."
199199
)
200200
private final Integer modifiedCount;
201201

202202
@Schema(
203203
title = "Upserted document ID",
204-
description = "ID of the document that was created if upsert was enabled and no match was found"
204+
description = "ID of the inserted document when upsert occurs; null otherwise."
205205
)
206206
private final String upsertedId;
207207
}
208-
}
208+
}

0 commit comments

Comments
 (0)