Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
Only use _id field to get streamer ID on delete operation
Browse files Browse the repository at this point in the history
  • Loading branch information
serebit committed May 8, 2021
1 parent d35cbaa commit 2496ec0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/kotlin/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ suspend fun main() = coroutineScope<Unit> {
}

val streamerID = when (doc.operationType) {
OperationType.INSERT -> doc.fullDocument!!.getString("streamer_id")?.toLong() ?: return@launchWatch
OperationType.DELETE, OperationType.UPDATE, OperationType.REPLACE ->
ByteBuffer.wrap(doc.documentKey!!.getBinary("_id").data).long
OperationType.INSERT, OperationType.UPDATE, OperationType.REPLACE ->
doc.fullDocument!!.getString("streamer_id")?.toLong() ?: return@launchWatch
OperationType.DELETE -> ByteBuffer.wrap(doc.documentKey!!.getBinary("_id").data).long
else -> return@launchWatch
}

Expand Down

0 comments on commit 2496ec0

Please sign in to comment.