Skip to content

Commit 295c666

Browse files
committed
Add missing collection API descriptions and missing page sections
1 parent bcbb2fa commit 295c666

12 files changed

+111
-14
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
You can read, query, and sort a :cpp-sdk:`list
2+
<structrealm_1_1managed_3_01std_1_1vector_3_01T_01_5_01_4_01_4.html>` similar
3+
to working with a :cpp-sdk:`results
4+
<structrealm_1_1internal_1_1bridge_1_1results.html>` collection. You can also
5+
work with a list as a results set by calling the ``as_results()`` public member
6+
function of the managed list class.

source/includes/api-details/cpp/crud/read-sdk-results-collections-description.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,10 @@ has these characteristics:
1111
contents change. If they derive from frozen objects, they represent only a
1212
snapshot and do not automatically update.
1313
- You cannot manually initialize an empty results set. Results can only
14-
be initialized as the result of a query.
14+
be initialized:
15+
16+
- As the result of a query.
17+
- From a managed :ref:`list <sdks-read-list>`, using the
18+
:cpp-sdk:`as_results()
19+
<structrealm_1_1managed_3_01std_1_1vector_3_01T_01_5_01_4_01_4.html>`
20+
member funcion.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
You can query and iterate through a :ref:`RealmDictionary <sdks-dictionary-property-types>`
2+
property as you would an
3+
`IDictionary <https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.idictionary-2?view=net-8.0>`__.
4+
5+
The SDK also provides a convenience method to cast an ``IDictionary<T>`` to an
6+
``IRealmCollection<T>``. To convert a dictionary to an SDK collection, call the
7+
:dotnet-sdk:`AsRealmCollection\<T\>
8+
<reference/Realms.CollectionExtensions.html#Realms_CollectionExtensions_AsRealmCollection__1_System_Collections_Generic_IDictionary_System_String___0__>`
9+
method with the ``IDictionary<T>`` as its argument.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
SDK lists implement the :dotnet-sdk:`IRealmCollection\<T\>
2+
<reference/Realms.IRealmCollection-1.html>` interface, which provides a range
3+
of properties and methods to simplify reading and querying from the list.
4+
You can query an SDK list using the same :ref:`query engines and operators
5+
<sdks-read-query-objects>` as a results set.
6+
7+
The SDK also provides a convenience method to cast an ``IList<T>`` to an
8+
``IRealmCollection<T>``. To convert a list to an SDK collection, call the
9+
:dotnet-sdk:`AsRealmCollection\<T\>
10+
<reference/Realms.CollectionExtensions.html#Realms_CollectionExtensions_AsRealmCollection__1_System_Collections_Generic_IList___0__>`
11+
method with the ``IList<T>`` as its argument.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
SDK sets implement the :dotnet-sdk:`IRealmCollection\<T\>
2+
<reference/Realms.IRealmCollection-1.html>` interface, which provides a range
3+
of properties and methods to simplify reading and querying from the set.
4+
You can query an SDK set using the same :ref:`query engines and operators
5+
<sdks-read-query-objects>` as a results set.
6+
7+
The SDK also provides a convenience method to cast an ``ISet<T>`` to an
8+
``IRealmCollection<T>``. To convert a set to an SDK collection, call the
9+
:dotnet-sdk:`AsRealmCollection\<T\>
10+
<reference/Realms.CollectionExtensions.html#Realms_CollectionExtensions_AsRealmCollection__1_System_Collections_Generic_ISet___0__>`
11+
method with the ``ISet<T>`` as its argument.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Get a ``RealmList`` by property name with
22
:flutter-sdk:`dynamic.getList() <realm//DynamicRealmObject/getList.html>`.
33

4+
You can also work with a list as a results set. Call the
5+
:flutter-sdk:`RealmList\<T\>.asResults() <realm/RealmList/asResults.html>`
6+
method to convert the list to a :flutter-sdk:`RealmResults\<T\>
7+
<realm/RealmResults-class.html>`.
8+
49
The following example demonstrates some basic usage of ``RealmList``.
510
For more information about all available methods, refer to the
611
:flutter-sdk:`RealmList reference <realm/RealmList-class.html>` documentation.

source/includes/api-details/dart/crud/read-sdk-results-collections-description.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@ operation, and has these characteristics:
1111
contents change in the isolate context. If they derive from frozen objects,
1212
they represent only a snapshot and do not automatically update.
1313
- You cannot manually initialize an empty ``RealmResults`` set. Results can
14-
only be initialized as the result of a query.
14+
only be initialized:
15+
16+
- As the result of a query.
17+
- From a ``RealmList`` or ``RealmSet``, by calling the ``asResults()`` method.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
You can read, query, iterate over, and sort a :java-sdk:`RealmList
2+
<io/realm/RealmList.html>` similar to working with a :cpp-sdk:`RealmResults
3+
<io/realm/RealmResults.html>` collection.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
You can read, query, and sort a :js-sdk:`List
2+
<classes/Realm.Types.List.html>` similar to working with a :js-sdk:`results
3+
<classes/Realm.Results.html>` collection.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
You can query a :objc-sdk:`RLMDictionary
2+
<Classes/RLMDictionary.html>` with the same predicates as :objc-sdk:`RLMObject
3+
<Classes/RLMObject.html>` and :objc-sdk:`RLMResults <Classes/RLMResults.html>`.
4+
5+
- Access :objc-sdk:`allKeys
6+
<Classes/RLMDictionary.html#/c:objc(cs)RLMDictionary(py)allKeys>` or
7+
:objc-sdk:`allValues
8+
<Classes/RLMDictionary.html#/c:objc(cs)RLMDictionary(py)allValues>`.
9+
- Get the :objc-sdk:`-objectForKey:
10+
<Classes/RLMDictionary.html#/c:objc(cs)RLMDictionary(im)objectForKey:>` or
11+
:objc-sdk:`-valueForKey:
12+
<Classes/RLMDictionary.html#/c:objc(cs)RLMDictionary(im)valueForKey:>`.
13+
- Work with keys and objects using :objc-sdk:`-enumerateKeysAndObjectsUsingBlock:
14+
<Classes/RLMDictionary.html#/c:objc(cs)RLMDictionary(im)enumerateKeysAndObjectsUsingBlock:>`.
15+
16+
.. tip:: RLMDictionary may contain keys whose values are nil
17+
18+
An SDK map may contain keys with ``nil`` values. If you delete an object
19+
that is used as a map value, the value is set to ``nil`` but the key
20+
remains unless you explicitly delete it. If your app deletes map values
21+
without also explicitly cleaning up the keys, you may need to perform
22+
optional unwrapping when you read map values.

0 commit comments

Comments
 (0)