Members
The number of objects in the list.
Type:
number
Methods
- query
- Type:
string
Query used to filter results.
- arg optional repeatable
- Type:
any
Each subsequent argument is used by the placeholders (e.g.
$0
,$1
,$2
, …) in the query.-
Error
If the query or any other argument passed into this method is invalid.
-
Error
If not inside a write transaction.
- object repeatable
- Type:
Realm.Object
Each object’s type must match
objectType
specified in the schema.-
TypeError
If an
object
is of the wrong type.
-
Error
If not inside a write transaction.
-
Error
If not inside a write transaction.
- descriptor
- Type:
string
or[SortDescriptor, ...]
The property name(s) to sort results by.
- reverse optional
- Type:
boolean
- Default:
false
May only be provided if
descriptor
is a string.-
Error
If a specified property does not exist.
- object repeatable
- Type:
Realm.Object
Each object’s type must match
objectType
specified in the schema.-
TypeError
If an
object
is of the wrong type.
-
Error
If not inside a write transaction.
Realm.Results
Returns new results that represent this list being filtered by the provided query.
let merlots = wines.filtered('varietal == "Merlot" && vintage <= $0', maxYear);
Parameters:
Throws:
Realm.Results
filtered according to the provided query.
Realm.Object
or undefined
Remove the last object from the list and return it.
Throws:
Realm.Object
or undefined
if the list is empty.
number
Add one or more objects to the end of the list.
Parameters:
Throws:
number
equal to the new length
of the list
after adding objects.
Realm.Object
or undefined
Remove the first object from the list and return it.
Throws:
Realm.Object
or undefined
if the list is empty.
Realm.Results
Create a frozen snapshot of the list. This means changes to the list will not be
reflected in the results returned by this method. However, deleted objects will become
null
at their respective indices.
Realm.Results
which will not live update.
Realm.Results
Returns new results that represent this list being sorted by the provided property (or properties) of each object.
Parameters:
Throws:
Realm.Results
sorted according to the arguments passed in
number
Add one or more objects to the beginning of the list.
Parameters:
Throws:
number
equal to the new length
of the list
after adding objects.