Trim leading whitespace characters using trimMargin in Kotlin

Trim leading whitespace characters using trimMargin in Kotlin : Kotlin comes with a really handy function for string to trim leading whitespace characters easily. Known as trimMargin(), the definition of the function is as below : fun String.trimMargin(marginPrefix: String = “|”) – trimMargin is used to trim leading whitespace characters from each line of a […]

How to drop a collection in MongoDB

Introduction : Dropping a collection will remove it from the database. It will also remove any index associated with the dropped collection. It also removes all indexes associated with the dropped collection. This method will obtain a write lock on the database. It will block all other operations till the drop is completed. Collection drop […]