![]() |
VOOZH | about |
dotnet add package Realm --version 20.1.0
NuGet\Install-Package Realm -Version 20.1.0
<PackageReference Include="Realm" Version="20.1.0" />
<PackageVersion Include="Realm" Version="20.1.0" />Directory.Packages.props
<PackageReference Include="Realm" />Project file
paket add Realm --version 20.1.0
#r "nuget: Realm, 20.1.0"
#:package Realm@20.1.0
#addin nuget:?package=Realm&version=20.1.0Install as a Cake Addin
#tool nuget:?package=Realm&version=20.1.0Install as a Cake Tool
<picture> <source srcset="./media/logo-dark.svg" media="(prefers-color-scheme: dark)" alt="realm by MongoDB"> <img src="./media/logo.svg" alt="realm by MongoDB"> </picture>
Realm is a mobile database that runs directly on phones, tablets or wearables. It supports all major mobile and desktop operating systems, such as iOS, Android, UWP, macOS, Linux, and Windows. For a full list of supported platforms and their versions, check out the Platform and Framework Compatibility section in the documentation.
Define a persistable model by inheriting from IRealmObject. The Realm source generator will generate an implementation for most of the functionality, so you only need to specify the properties you want to persist:
public partial class Person : IRealmObject
{
[PrimaryKey]
public ObjectId Id { get; private set; } = ObjectId.GenerateNewId();
public string FirstName { get; set; }
public string LastName { get; set; }
public DateTimeOffset Birthday { get; set; }
// You can define constructors as usual
public Person(string firstName, string lastName)
{
FirstName = firstName;
LastName = lastName;
}
}
Open a Realm instance by calling Realm.GetInstance:
// You can provide a relative or an absolute path to the Realm file or let
// Realm use the default one.
var realm = Realm.GetInstance("people.realm");
Add, read, update, and remove objects by calling the corresponding API on the Realm instance:
// Always mutate the Realm instance in a write transaction
realm.Write(() =>
{
realm.Add(new Person("John", "Smith"));
});
var peopleWithJ = realm.All<Person>().Where(p => p.FirstName.StartsWith("J"));
// All Realm collections and objects are reactive and implement INotifyCollectionChanged/INotifyPropertyChanged
peopleWithJ.AsRealmCollection().CollectionChanged += (s, e) =>
{
// React to notifications
};
For more examples, see the detailed instructions in our User Guide to add Realm to your solution.
The documentation can be found at mongodb.com/docs/atlas/device-sdks/sdk/dotnet/. The API reference is located at mongodb.com/docs/realm-sdks/dotnet/latest/.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net46 net46 is compatible. net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid is compatible. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios is compatible. |
| Xamarin.Mac | xamarinmac xamarinmac is compatible. |
| Xamarin.TVOS | xamarintvos xamarintvos is compatible. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Realm:
| Package | Downloads |
|---|---|
|
ppy.osu.Game
Package Description |
|
|
ItEnterprise.Common.CoreStandard
ItEnterprise Common.CoreStandard for Xamarin Forms |
|
|
Iridium360.Connect.Framework
This framework allows you to bind your Android or iOS device with i360RockSTAR tracker |
|
|
AIC.Core.Data.MongoDb.Realm
Shared .NET library for Aerospace, Intelligence, and Cyber solutions. |
|
|
Arc4u.Standard.Diagnostics.Serilog.Sinks.RealmDb
Package Description |
Showing the top 9 popular GitHub repositories that depend on Realm:
| Repository | Stars |
|---|---|
|
ppy/osu
rhythm is just a *click* away!
|
|
|
LagrangeDev/Lagrange.Core
An Implementation of NTQQ Protocol, with Pure C#, Derived from Konata.Core
|
|
|
kabiiQ/BeatmapExporter
osu! Lazer file exporter utility. Enables mass export of beatmaps from the new osu! Lazer file storage back into .osz files, in addition to replays, skins, and collections.
|
|
|
sgermosen/xReader
XML, NEWS, RSS & Scrapping Reader maked in Xamarin, for educational purpose.
|
|
|
Piotrekol/CollectionManager
An extensive tool for creating, editing, and exporting of osu! collections.
|
|
|
realm/realm-draw
The official Realm Draw app used in promotional videos
|
|
|
dsa28s/windows-hangul-clock
Hangul Clock for Windows Desktop Widget
|
|
|
InventiveRhythm/fluXis
A community-driven rhythm game with a focus on creativity and expression.
|
|
|
Founntain/osuplayer
Official osu!player repository. osu!player is a music player for the game osu! made by Dean 'peppy' Herbert. Written in the cross-platform framework AvaloniaUI
|
| Version | Downloads | Last Updated |
|---|---|---|
| 20.1.0 | 402,337 | 1/7/2025 |
| 20.0.0 | 76,522 | 9/9/2024 |
| 12.5.0 | 35,902 | 1/2/2025 |
| 12.4.1 | 47,607 | 9/16/2024 |
| 12.4.0 | 44,584 | 8/25/2024 |
| 12.3.0 | 63,565 | 7/20/2024 |
| 12.2.0 | 68,781 | 5/22/2024 |
| 12.1.0 | 18,647 | 5/1/2024 |
| 12.0.0 | 14,461 | 4/17/2024 |
| 11.7.0 | 128,641 | 2/5/2024 |
| 11.6.1 | 107,345 | 11/17/2023 |
| 11.6.0 | 29,870 | 11/4/2023 |
| 11.5.0 | 340,434 | 9/16/2023 |
| 11.4.0 | 42,293 | 8/16/2023 |
| 11.3.0 | 77,452 | 7/26/2023 |
| 11.2.0 | 21,403 | 7/8/2023 |
| 11.1.2 | 124,235 | 6/20/2023 |
| 11.1.1 | 8,978 | 6/19/2023 |
| 11.1.0 | 3,111 | 6/17/2023 |
| 11.0.0 | 63,413 | 5/8/2023 |
## 20.1.0 (2025-01-07)
### Breaking Changes
* Support for UWP on arm32 has been removed due to the Windows SDK no longer supporting 32-bit ARM. (PR [#3683](https://github.com/realm/realm-dotnet/pull/3683))
* Support for Xamarin projects has been deprecated. While we still expect the SDK to work, we no longer actively test against Xamarin as it has been end-of-life'd by Microsoft since May. (PR [#3683](https://github.com/realm/realm-dotnet/pull/3683))
* Support for .NET 6 is deprecated. We still expect everything to work, but we'll retarget the SDK to the latest LTS version (8.0) in a future release. (PR [#3683](https://github.com/realm/realm-dotnet/pull/3683))
### Fixed
* Having a query with a number of predicates ORed together may result in a crash on some platforms (strict weak ordering check failing on iphone). (Core 14.13.0)
* Migrating primary key to a new type without migration function would cause an assertion to fail. (Core 20.1.1)
* Opening a Realm on Pixel devices running Android 14+ could result in a hardlock. (Core 20.1.2)
### Compatibility
* Realm Studio: 15.0.0 or later.
### Internal
* Using Core 20.1.2.