From f4442be2f4f8813497c06b5b4e0c81207815997c Mon Sep 17 00:00:00 2001 From: Shruti Mantri Date: Sat, 27 Jan 2024 14:33:03 +0530 Subject: [PATCH] fix(docs): corrected the docs for plugin-mongodb --- .../kestra/plugin/mongodb/AbstractLoad.java | 8 +++--- .../kestra/plugin/mongodb/AbstractTask.java | 6 ++-- .../java/io/kestra/plugin/mongodb/Bulk.java | 2 +- .../java/io/kestra/plugin/mongodb/Delete.java | 10 +++---- .../java/io/kestra/plugin/mongodb/Find.java | 28 +++++++++---------- .../io/kestra/plugin/mongodb/InsertOne.java | 14 +++++----- .../java/io/kestra/plugin/mongodb/Load.java | 6 ++-- .../plugin/mongodb/MongoDbConnection.java | 4 +-- .../java/io/kestra/plugin/mongodb/Update.java | 22 +++++++-------- 9 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/main/java/io/kestra/plugin/mongodb/AbstractLoad.java b/src/main/java/io/kestra/plugin/mongodb/AbstractLoad.java index 61675bb..798e7b5 100644 --- a/src/main/java/io/kestra/plugin/mongodb/AbstractLoad.java +++ b/src/main/java/io/kestra/plugin/mongodb/AbstractLoad.java @@ -32,14 +32,14 @@ @NoArgsConstructor public abstract class AbstractLoad extends AbstractTask implements RunnableTask { @Schema( - title = "The source file" + title = "The source file." ) @PluginProperty(dynamic = true) @NotNull private String from; @Schema( - title = "The size of chunk for every bulk request" + title = "Chunk size for every bulk request." ) @PluginProperty(dynamic = true) @Builder.Default @@ -95,7 +95,7 @@ public Output run(RunContext runContext) throws Exception { )); logger.info( - "Successfully send {} requests for {} records", + "Successfully sent {} requests for {} records", requestCount, count.get() ); @@ -114,7 +114,7 @@ public Output run(RunContext runContext) throws Exception { @Getter public static class Output implements io.kestra.core.models.tasks.Output { @Schema( - title = "The size of the rows processed" + title = "The number of rows processed." ) private Long size; diff --git a/src/main/java/io/kestra/plugin/mongodb/AbstractTask.java b/src/main/java/io/kestra/plugin/mongodb/AbstractTask.java index f4d5fd4..12976c3 100644 --- a/src/main/java/io/kestra/plugin/mongodb/AbstractTask.java +++ b/src/main/java/io/kestra/plugin/mongodb/AbstractTask.java @@ -25,20 +25,20 @@ @NoArgsConstructor public abstract class AbstractTask extends Task { @Schema( - title = "The connection properties." + title = "MongoDB connection properties." ) @NotNull protected MongoDbConnection connection; @Schema( - title = "The mongodb database." + title = "MongoDB database." ) @PluginProperty(dynamic = true) @NotNull protected String database; @Schema( - title = "The mongodb collection." + title = "MongoDB collection." ) @PluginProperty(dynamic = true) @NotNull diff --git a/src/main/java/io/kestra/plugin/mongodb/Bulk.java b/src/main/java/io/kestra/plugin/mongodb/Bulk.java index 4e847ed..3b3bee4 100644 --- a/src/main/java/io/kestra/plugin/mongodb/Bulk.java +++ b/src/main/java/io/kestra/plugin/mongodb/Bulk.java @@ -26,7 +26,7 @@ @Getter @NoArgsConstructor @Schema( - title = "Execute [Bulk](https://www.mongodb.com/docs/manual/reference/method/Bulk/) request in MongoDB" + title = "Execute [Bulk](https://www.mongodb.com/docs/manual/reference/method/Bulk/) request in MongoDB." ) @Plugin( examples = { diff --git a/src/main/java/io/kestra/plugin/mongodb/Delete.java b/src/main/java/io/kestra/plugin/mongodb/Delete.java index 51fd2b1..473d98a 100644 --- a/src/main/java/io/kestra/plugin/mongodb/Delete.java +++ b/src/main/java/io/kestra/plugin/mongodb/Delete.java @@ -25,7 +25,7 @@ @Getter @NoArgsConstructor @Schema( - title = "Delete one or many documents" + title = "Delete one or many documents from a MongoDB collection." ) @Plugin( examples = { @@ -45,14 +45,14 @@ ) public class Delete extends AbstractTask implements RunnableTask { @Schema( - title = "The mongodb bson filter", - description = "Can be a bson string, or a map" + title = "MongoDB BSON filter.", + description = "Can be a BSON string, or a map." ) @PluginProperty(dynamic = true) private Object filter; @Schema( - title = "Operation to use" + title = "Operation to use." ) @PluginProperty(dynamic = false) @Builder.Default @@ -100,7 +100,7 @@ public enum Operation { @Getter public static class Output implements io.kestra.core.models.tasks.Output { @Schema( - title = "true if the write was acknowledged." + title = "Whether the write was acknowledged." ) private Boolean wasAcknowledged; diff --git a/src/main/java/io/kestra/plugin/mongodb/Find.java b/src/main/java/io/kestra/plugin/mongodb/Find.java index 5d27f0a..27c0363 100644 --- a/src/main/java/io/kestra/plugin/mongodb/Find.java +++ b/src/main/java/io/kestra/plugin/mongodb/Find.java @@ -35,7 +35,7 @@ @Getter @NoArgsConstructor @Schema( - title = "Find documents" + title = "Find documents from a MongoDB collection." ) @Plugin( examples = { @@ -54,41 +54,41 @@ ) public class Find extends AbstractTask implements RunnableTask { @Schema( - title = "The mongodb bson filter", - description = "Can be a bson string, or a map" + title = "MongoDB BSON filter.", + description = "Can be a BSON string, or a map." ) @PluginProperty(dynamic = true) private Object filter; @Schema( - title = "The mongodb bson projection", - description = "Can be a bson string, or a map" + title = "MongoDB BSON projection.", + description = "Can be a BSON string, or a map." ) @PluginProperty(dynamic = true) private Object projection; @Schema( - title = "The mongodb bson sort", - description = "Can be a bson string, or a map" + title = "MongoDB BSON sort.", + description = "Can be a BSON string, or a map." ) @PluginProperty(dynamic = true) private Object sort; @Schema( - title = "The number of records to return" + title = "The number of records to return." ) @PluginProperty(dynamic = true) private Integer limit; @Schema( - title = "The number of records to skip" + title = "The number of records to skip." ) @PluginProperty(dynamic = true) private Integer skip; @Schema( - title = "Whether to store the data from the query result into an ion serialized data file" + title = "Whether to store the data from the query result into an ion serialized data file." ) @PluginProperty(dynamic = false) @Builder.Default @@ -189,19 +189,19 @@ private Pair, Long> fetch(FindIterable documents @Getter public static class Output implements io.kestra.core.models.tasks.Output { @Schema( - title = "List containing the fetched data", + title = "List containing the fetched data.", description = "Only populated if `store` parameter is set to false." ) private List rows; @Schema( - title = "The size of the rows fetch" + title = "The number of rows fetched." ) private Long size; @Schema( - title = "The uri of store result", - description = "Only populated if `store` is set to true." + title = "URI of the file containing the fetched results.", + description = "Only populated if `store` parameter is set to true." ) private URI uri; } diff --git a/src/main/java/io/kestra/plugin/mongodb/InsertOne.java b/src/main/java/io/kestra/plugin/mongodb/InsertOne.java index edab595..410ca02 100644 --- a/src/main/java/io/kestra/plugin/mongodb/InsertOne.java +++ b/src/main/java/io/kestra/plugin/mongodb/InsertOne.java @@ -25,12 +25,12 @@ @Getter @NoArgsConstructor @Schema( - title = "Insert one document" + title = "Insert a document into a MongoDB collection." ) @Plugin( examples = { @Example( - title = "Insert a document with a map", + title = "Insert a document with a map.", code = { "connection:", " uri: \"mongodb://root:example@localhost:27017/?authSource=admin\"", @@ -44,7 +44,7 @@ } ), @Example( - title = "Insert a document from a json string", + title = "Insert a document from a JSON string.", code = { "connection:", " uri: \"mongodb://root:example@localhost:27017/?authSource=admin\"", @@ -57,8 +57,8 @@ ) public class InsertOne extends AbstractTask implements RunnableTask { @Schema( - title = "The mongodb document", - description = "Can be a bson string, or a map" + title = "MongoDB document.", + description = "Can be a BSON string, or a map." ) @PluginProperty(dynamic = true) @NotNull @@ -93,12 +93,12 @@ public InsertOne.Output run(RunContext runContext) throws Exception { @Getter public static class Output implements io.kestra.core.models.tasks.Output { @Schema( - title = "The inserted Id" + title = "The inserted ID." ) private String insertedId; @Schema( - title = "true if the write was acknowledged." + title = "Whether the write was acknowledged." ) private Boolean wasAcknowledged; } diff --git a/src/main/java/io/kestra/plugin/mongodb/Load.java b/src/main/java/io/kestra/plugin/mongodb/Load.java index 683ea6d..35c7a5c 100644 --- a/src/main/java/io/kestra/plugin/mongodb/Load.java +++ b/src/main/java/io/kestra/plugin/mongodb/Load.java @@ -27,7 +27,7 @@ @Getter @NoArgsConstructor @Schema( - title = "Bulk load documents in MongoDB using Kestra Internal Storage file" + title = "Bulk load documents in MongoDB using Kestra internal storage file." ) @Plugin( examples = { @@ -44,13 +44,13 @@ ) public class Load extends AbstractLoad { @Schema( - title = "Use this key as id." + title = "Use this key as ID." ) @PluginProperty(dynamic = true) private String idKey; @Schema( - title = "Remove idKey from the final document" + title = "Whether to remove idKey from the final document." ) @PluginProperty(dynamic = true) @Builder.Default diff --git a/src/main/java/io/kestra/plugin/mongodb/MongoDbConnection.java b/src/main/java/io/kestra/plugin/mongodb/MongoDbConnection.java index 8ec4288..99a3f40 100644 --- a/src/main/java/io/kestra/plugin/mongodb/MongoDbConnection.java +++ b/src/main/java/io/kestra/plugin/mongodb/MongoDbConnection.java @@ -20,8 +20,8 @@ @Introspected public class MongoDbConnection { @Schema( - title = "Connection string to mongodb server ", - description = "[url format](https://docs.mongodb.com/manual/reference/connection-string/) " + + title = "Connection string to MongoDB server.", + description = "[URL format](https://docs.mongodb.com/manual/reference/connection-string/) " + "like `mongodb://mongodb0.example.com:27017`" ) @PluginProperty(dynamic = true) diff --git a/src/main/java/io/kestra/plugin/mongodb/Update.java b/src/main/java/io/kestra/plugin/mongodb/Update.java index 007cfac..9edf4b6 100644 --- a/src/main/java/io/kestra/plugin/mongodb/Update.java +++ b/src/main/java/io/kestra/plugin/mongodb/Update.java @@ -26,12 +26,12 @@ @Getter @NoArgsConstructor @Schema( - title = "Update or Replace one or many documents" + title = "Update or Replace one or many documents in a MongoDB collection." ) @Plugin( examples = { @Example( - title = "Replace a document", + title = "Replace a document.", code = { "connection:", " uri: \"mongodb://root:example@localhost:27017/?authSource=admin\"", @@ -49,7 +49,7 @@ } ), @Example( - title = "Update a document", + title = "Update a document.", code = { "connection:", " uri: \"mongodb://root:example@localhost:27017/?authSource=admin\"", @@ -65,23 +65,23 @@ ) public class Update extends AbstractTask implements RunnableTask { @Schema( - title = "The mongodb document", - description = "Can be a bson string, or a map" + title = "MongoDB document.", + description = "Can be a BSON string, or a map." ) @PluginProperty(dynamic = true) @NotNull private Object document; @Schema( - title = "The mongodb bson filter", - description = "Can be a bson string, or a map" + title = "MongoDB BSON filter.", + description = "Can be a BSON string, or a map." ) @PluginProperty(dynamic = true) @NotNull private Object filter; @Schema( - title = "Operation to use" + title = "Operation to use." ) @PluginProperty(dynamic = false) @Builder.Default @@ -134,14 +134,14 @@ public enum Operation { @Getter public static class Output implements io.kestra.core.models.tasks.Output { @Schema( - title = "The upserted Id", - description = "Will be null if `replace` operation" + title = "The upserted ID.", + description = "Will be null for `replace` operation." ) @Nullable private String upsertedId; @Schema( - title = "true if the write was acknowledged." + title = "Whether the write was acknowledged." ) private Boolean wasAcknowledged;