diff --git a/driver-multiplatform/src/commonMain/kotlin/MultiplatformMongoCollectionImpl.kt b/driver-multiplatform/src/commonMain/kotlin/MultiplatformMongoCollectionImpl.kt index 3c243339..735f39db 100644 --- a/driver-multiplatform/src/commonMain/kotlin/MultiplatformMongoCollectionImpl.kt +++ b/driver-multiplatform/src/commonMain/kotlin/MultiplatformMongoCollectionImpl.kt @@ -194,11 +194,45 @@ internal class MultiplatformMongoCollectionImpl( } override suspend fun deleteOne(options: DeleteOneOptions.() -> Unit, filter: FilterQuery.() -> Unit) { - TODO("Not yet implemented") + val message = database.client.wire.sendSingle( + database.client.createOpMsg { + document { + writeString("delete", name) + writeString($$"$db", database.name) + + DeleteOne( + context = database.client.context, + ).apply { + this.options.options() + this.filter.filter() + }.writeTo(this) + } + } + ) + + message as Message.OpMsg + check(message.body.document["ok"]?.decodeDouble() == 1.0) } override suspend fun deleteMany(options: DeleteManyOptions.() -> Unit, filter: FilterQuery.() -> Unit) { - TODO("Not yet implemented") + val message = database.client.wire.sendSingle( + database.client.createOpMsg { + document { + writeString("delete", name) + writeString($$"$db", database.name) + + DeleteMany( + context = database.client.context, + ).apply { + this.options.options() + this.filter.filter() + }.writeTo(this) + } + } + ) + + message as Message.OpMsg + check(message.body.document["ok"]?.decodeDouble() == 1.0) } override fun find(): MultiplatformMongoIterable =