Skip to content

Commit

Permalink
More upsert amendments
Browse files Browse the repository at this point in the history
  • Loading branch information
RawToast committed Mar 25, 2018
1 parent 5f860dd commit 02c7a88
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class MongoRepository(connectionString: String, databaseName: String, collection
.flatMap(toUserReadingHistory)

def put(g: UserReadingHistory): IO[UserReadingHistory] =
collection.replaceOne(equal("uuid", g.userId.toString), Document.parse(g.asJson.spaces2),
collection.replaceOne(equal("userId", g.userId), Document.parse(g.asJson.spaces2),
model.UpdateOptions().upsert(true)).asIO
.map(_ => g)

Expand Down

0 comments on commit 02c7a88

Please sign in to comment.