Docs Menu

Docs HomeRealm

Open a Realm - Kotlin SDK

On this page

  • Open a Realm
  • Close a Realm

To open a realm, create a RealmConfiguration with RealmConfiguration.Builder and pass the resulting RealmConfiguration to

val config = RealmConfiguration.Builder(setOf(Frog::class))
val realm =
Log.v("Successfully opened realm: ${}")

You can close a realm with realm.close(). The close() method blocks until all write transactions on the realm have completed.

←  Relationships - Kotlin SDKWrite Transactions - Kotlin SDK →
Give Feedback
© 2022 MongoDB, Inc.


  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.