Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MonsterChenzhuo committed Jun 1, 2023
1 parent 1adb461 commit 64197d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ public class MongoKeyExtractor implements SerializableFunction<BsonDocument, Bso

private static final long serialVersionUID = 1L;

private final String[] upsertKey;
private final String[] primaryKey;

public MongoKeyExtractor(MongodbWriterOptions options) {
upsertKey = options.getPrimaryKey();
primaryKey = options.getPrimaryKey();
}

@Override
public BsonDocument apply(BsonDocument bsonDocument) {
return Arrays.stream(upsertKey)
return Arrays.stream(primaryKey)
.filter(bsonDocument::containsKey)
.collect(
Collectors.toMap(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public Builder withUpsertEnable(boolean upsertEnable) {
return this;
}

public Builder withPrimaryKey(String[] upsertKey) {
public Builder withPrimaryKey(String[] primaryKey) {
this.primaryKey = primaryKey;
return this;
}
Expand Down

0 comments on commit 64197d1

Please sign in to comment.