Changelog
12.10.0 (2024-06-14)
counter
presentation data type has been introduced. The int
data type can now be used as a logical counter for performing numeric updates that need to be synchronized as sequentially consistent events rather than individual reassignments of the number. (#6694)
class MyObject extends Realm.Object {
_id!: BSON.ObjectId;
counter!: Realm.Types.Counter;
static schema: ObjectSchema = {
name: "MyObject",
primaryKey: "_id",
properties: {
_id: { type: "objectId", default: () => new BSON.ObjectId() },
counter: "counter",
// or: counter: { type: "int", presentation: "counter" },
},
};
}
const realm = await Realm.open({ schema: [MyObject] });
const object = realm.write(() => {
return realm.create(MyObject, { counter: 0 });
});
realm.write(() => {
object.counter.increment();
object.counter.value; // 1
object.counter.decrement(2);
object.counter.value; // -1
});
immediatelyRunFileActions
was not added to the bindgen's opt-list. This could lead to the error TypeError: app.internal.immediatelyRunFileActions is not a function
. (#6708, since v12.8.0)off_t
, which is a 32-bit type on 64-bit Windows. (realm/realm-core#7698, since the introduction of encryption support on Windows - likely in v1.11.0)Changelog
12.10.0-rc.0 (2024-05-31)
counter
presentation data type has been introduced. The int
data type can now be used as a logical counter for performing numeric updates that need to be synchronized as sequentially consistent events rather than individual reassignments of the number. (#6694)
class MyObject extends Realm.Object {
_id!: BSON.ObjectId;
counter!: Realm.Types.Counter;
static schema: ObjectSchema = {
name: "MyObject",
primaryKey: "_id",
properties: {
_id: { type: "objectId", default: () => new BSON.ObjectId() },
counter: "counter",
// or: counter: { type: "int", presentation: "counter" },
},
};
}
const realm = await Realm.open({ schema: [MyObject] });
const object = realm.write(() => {
return realm.create(MyObject, { counter: 0 });
});
realm.write(() => {
object.counter.increment();
object.counter.value; // 1
object.counter.decrement(2);
object.counter.value; // -1
});
Changelog
12.9.0 (2024-05-23)
mixed
value can now hold a Realm.List
and Realm.Dictionary
with nested collections. Note that Realm.Set
is not supported as a mixed
value. (#6613)class CustomObject extends Realm.Object {
value!: Realm.Types.Mixed;
static schema: ObjectSchema = {
name: "CustomObject",
properties: {
value: "mixed",
},
};
}
const realm = await Realm.open({ schema: [CustomObject] });
// Create an object with a dictionary value as the Mixed
// property, containing primitives and a list.
const realmObject = realm.write(() => {
return realm.create(CustomObject, {
value: {
num: 1,
string: "hello",
bool: true,
list: [
{
string: "world",
},
],
},
});
});
// Accessing the collection value returns the managed collection.
const dictionary = realmObject.value;
expectDictionary(dictionary);
const list = dictionary.list;
expectList(list);
const leafDictionary = list[0];
expectDictionary(leafDictionary);
console.log(leafDictionary.string); // "world"
// Update the Mixed property to a list.
realm.write(() => {
realmObject.value = [1, "hello", { newKey: "new value" }];
});
// Useful custom helper functions. (Will be provided in a future release.)
function expectList(value: unknown): asserts value is Realm.List {
if (!(value instanceof Realm.List)) {
throw new Error("Expected a 'Realm.List'.");
}
}
function expectDictionary(value: unknown): asserts value is Realm.Dictionary {
if (!(value instanceof Realm.Dictionary)) {
throw new Error("Expected a 'Realm.Dictionary'.");
}
}
...@links.@count
) and possibly notifications (realm/realm-core#7676 since v12.7.1).@trunk/launcher
from v1.3.0 to v1.3.1 to support Apple's versioning scheme for macOS.Changelog
12.8.1 (2024-05-15)
Realm.deleteFile
, Realm.exists
, Realm.schemaVersion
, Realm.determinePath
, Realm.transformConfig
and User#isLoggedIn
. (#6662, since v12.8.0)Realm.App#currentUser
from within a notification produced by Realm.App.switchUser
(which includes notifications for a newly logged in user) would deadlock. (realm/realm-core#7670, since v12.8.0)IN
query on a string
/int
/uuid
/objectId
property that was indexed. (realm/realm-core#7642 since v12.8.0)IN
query on an int
property where double
/float
parameters were ignored. (realm/realm-core#7642 since v12.8.0)5ba02142131efa3d97eda770ce33a85a2a085202
and 5462d47998b86459d328648c8057790a7b92af20
.Changelog
12.8.0 (2024-05-01)
MetadataMode.NoMetadata
is deprecated and will be removed. The new name is MetadataMode.InMemory
.App.baseUrl
and App.updateBaseUrl()
allow for retrieving and updating the base URL currently used for requests sent to Atlas App Services. These APIs are only available after importing "realm/experimental/base-url"
. (#6518)uuid
/objectId
types and RQL parsed IN
queries on string
/int
/uuid
/objectId
types. (realm/realm-dotnet#3566, since the introduction of these types)IN
query (or a query of the pattern x == 1 OR x == 2 OR x == 3
) when evaluating on a string property with an empty string in the search condition. Matches with an empty string would have been evaluated as if searching for a null string instead. (realm/realm-core#7628, since v10.0.0)App.allUsers()
included logged out users only if they were logged out while the App
instance existed. It now always includes all logged out users. (realm/realm-core#7300)Assertion failed: new_size % (1ULL << m_page_shift) == 0
when opening an encrypted Realm less than 64Mb that was generated on a platform with a different page size than the current platform. (#realm/realm-core#7322, since v12.0.0-rc.3)encrypted_file_mapping.hpp:183: Assertion failed: local_ndx < m_page_state.size()
. (realm/realm-core#7319)mixed
values returns inconsistent results. (realm/realm-core#7587, since v12.7.0-rc.0)MetadataMode.NoMetadata
) has been replaced with an in-memory metadata mode (MetadataMode.InMemory
) which performs similarly and doesn't work weirdly differently from the normal mode. The new mode is intended for testing purposes, but should be suitable for production usage if there is a scenario where metadata persistence is not needed. (realm/realm-core#7300)Changelog
12.7.1 (2024-04-19)
Changelog
12.7.0 (2024-04-17)
[!NOTE] This version bumps the Realm file format to version 24. It is not possible to downgrade to earlier versions. Older files will automatically be upgraded to the new file format. Files created by Realm JavaScript prior to v6.0.0, might not be upgradeable. Only Realm Studio 15.0.0 or later will be able to open the new file format.
[!NOTE] This version communicates with Atlas Device Services through a different URL (https://services.cloud.mongodb.com). While we consider this an internal detail of the SDK, you might need to update rules in firewalls or other configuration that you've used to limit connections made by your app.
$P<i>
in query string. (realm/realm-core#7033)@type
argument. (realm/realm-core#7289)Decimal128
properties has been optimized so that the individual values will take up 0 bits (if all nulls), 32 bits, 64 bits or 128 bits depending on what is needed. ([realm/realm-core#6111]https://github.com/realm/realm-core/pull/6111))>
, >=
, <
, <=
operators and fixed behavior that a null string should be evaluated as less than everything, previously nulls were not matched. (realm/realm-core#3939)Realm.setLogLevel
. (#6560)Mixed
property with an index possibly returning the wrong result if values of different types happened to have the same StringIndex hash. (realm/realm-core#6407, since v10.5.0-beta.1)@count
/@size
is now supported for Mixed
properties. (realm/realm-core#7280, since v10.0.0)indexed_property == NONE {x}
which mistakenly matched on only x
instead of not x
. This only applies when an indexed property with equality (==
, or IN
) matches with NONE
on a list of one item. If the constant list contained more than one value then it was working correctly. (realm/realm-java#7862, since v10.20.0)Bad server version
errors and a new client reset. (realm/realm-core#7279, since v12.5.0)data
and string
are now strongly typed for comparisons and queries. This change is especially relevant when querying for a string constant on a Mixed property, as now only strings will be returned. If searching for data
is desired, then that type must be specified by the constant. In RQL the new way to specify a binary constant is to use mixed = bin('xyz')
or mixed = binary('xyz')
. (realm/realm-core#6407)Changelog
12.7.0-rc.0 (2024-03-26)
[!NOTE] This version bumps the Realm file format to version 24. It is not possible to downgrade to earlier versions. Older files will automatically be upgraded to the new file format. Files created by Realm JavaScript prior to v6.0.0, might not be upgradeable. Only Realm Studio 15.0.0 or later will be able to open the new file format.
[!NOTE] This release doesn't include the changes previously released as v12.7.0-alpha.0 and is a pre-release because we plan on updating the
setLogLevel
API before releasing this asv12.7.0
: https://github.com/realm/realm-js/issues/6560 and we just wanted to get this out for Realm Studiov15.0.0
.
$P<i>
in query string. (realm/realm-core#7033)@type
argument. (realm/realm-core#7289)Decimal128
properties has been optimized so that the individual values will take up 0 bits (if all nulls), 32 bits, 64 bits or 128 bits depending on what is needed. ([realm/realm-core#6111]https://github.com/realm/realm-core/pull/6111))>
, >=
, <
, <=
operators and fixed behavior that a null string should be evaluated as less than everything, previously nulls were not matched. (realm/realm-core#3939)Realm.shutdown()
method, which closes all Realms, cancels all pending Realm.open
calls, clears internal caches, resets the logger and collects garbage. Call this method to free up the event loop and allow Node.js to perform a graceful exit. (#6571, since v12.0.0)Mixed
property with an index possibly returning the wrong result if values of different types happened to have the same StringIndex hash. (realm/realm-core#6407, since v10.5.0-beta.1)@count
/@size
is now supported for Mixed
properties. (realm/realm-core#7280, since v10.0.0)indexed_property == NONE {x}
which mistakenly matched on only x
instead of not x
. This only applies when an indexed property with equality (==
, or IN
) matches with NONE
on a list of one item. If the constant list contained more than one value then it was working correctly. (realm/realm-java#7862, since v10.20.0)Bad server version
errors and a new client reset. (realm/realm-core#7279, since v12.5.0)data
and string
are now strongly typed for comparisons and queries. This change is especially relevant when querying for a string constant on a Mixed property, as now only strings will be returned. If searching for data
is desired, then that type must be specified by the constant. In RQL the new way to specify a binary constant is to use mixed = bin('xyz')
or mixed = binary('xyz')
. (realm/realm-core#6407)