Skip to content

Commit

Permalink
Merge pull request #5 from shrutimantri/doc_correction_1
Browse files Browse the repository at this point in the history
fix(docs): corrected the docs for plugin-mongodb
  • Loading branch information
anna-geller authored Jan 31, 2024
2 parents a65c702 + f4442be commit e7e095a
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 50 deletions.
8 changes: 4 additions & 4 deletions src/main/java/io/kestra/plugin/mongodb/AbstractLoad.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
@NoArgsConstructor
public abstract class AbstractLoad extends AbstractTask implements RunnableTask<AbstractLoad.Output> {
@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
Expand Down Expand Up @@ -94,7 +94,7 @@ public Output run(RunContext runContext) throws Exception {
));

logger.info(
"Successfully send {} requests for {} records",
"Successfully sent {} requests for {} records",
requestCount,
count.get()
);
Expand All @@ -113,7 +113,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;

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/kestra/plugin/mongodb/AbstractTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,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
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/kestra/plugin/mongodb/Bulk.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,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 = {
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/io/kestra/plugin/mongodb/Delete.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -45,14 +45,14 @@
)
public class Delete extends AbstractTask implements RunnableTask<Delete.Output> {
@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
Expand Down Expand Up @@ -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;

Expand Down
28 changes: 14 additions & 14 deletions src/main/java/io/kestra/plugin/mongodb/Find.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
@Getter
@NoArgsConstructor
@Schema(
title = "Find documents"
title = "Find documents from a MongoDB collection."
)
@Plugin(
examples = {
Expand All @@ -54,41 +54,41 @@
)
public class Find extends AbstractTask implements RunnableTask<Find.Output> {
@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
Expand Down Expand Up @@ -189,19 +189,19 @@ private Pair<ArrayList<Object>, Long> fetch(FindIterable<BsonDocument> 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<Object> 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;
}
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/io/kestra/plugin/mongodb/InsertOne.java
Original file line number Diff line number Diff line change
Expand Up @@ -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\"",
Expand All @@ -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\"",
Expand All @@ -57,8 +57,8 @@
)
public class InsertOne extends AbstractTask implements RunnableTask<InsertOne.Output> {
@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
Expand Down Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/kestra/plugin/mongodb/Load.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,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 = {
Expand All @@ -46,13 +46,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
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/kestra/plugin/mongodb/MongoDbConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/io/kestra/plugin/mongodb/Update.java
Original file line number Diff line number Diff line change
Expand Up @@ -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\"",
Expand All @@ -49,7 +49,7 @@
}
),
@Example(
title = "Update a document",
title = "Update a document.",
code = {
"connection:",
" uri: \"mongodb://root:example@localhost:27017/?authSource=admin\"",
Expand All @@ -65,23 +65,23 @@
)
public class Update extends AbstractTask implements RunnableTask<Update.Output> {
@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
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit e7e095a

Please sign in to comment.