Skip to content

Latest commit

 

History

History
635 lines (397 loc) · 17.6 KB

query.md

File metadata and controls

635 lines (397 loc) · 17.6 KB

RealmQuery


realmQuery.beginsWith(fieldName, value, casing) ⇒ RealmQuery

Condition that the value of field begins with the specified string

Kind: instance method of RealmQuery

Param Type Description
fieldName string
value string
casing boolean BEGINSWITH[c] or BEGINSWITH

realmQuery.orBeginsWith(fieldName, value, casing) ⇒ RealmQuery

OR Condition that the value of field begins with the specified string

Kind: instance method of RealmQuery

Param Type Description
fieldName string
value string
casing boolean BEGINSWITH[c] or BEGINSWITH

realmQuery.between(fieldName, from, to) ⇒ RealmQuery

Between condition

Kind: instance method of RealmQuery

Param Type
fieldName string
from CompareValueType
to CompareValueType

realmQuery.orBetween(fieldName, from, to) ⇒ RealmQuery

Or between condition

Kind: instance method of RealmQuery

Param Type
fieldName string
from CompareValueType
to CompareValueType

realmQuery.contains(fieldName, value, casing) ⇒ RealmQuery

Condition that value of field contains the specified substring

Kind: instance method of RealmQuery

Param Type Description
fieldName string
value string
casing boolean CONTAINS[c] or CONTAINS

realmQuery.orContains(fieldName, value, casing) ⇒ RealmQuery

OR Condition that value of field contains the specified substring

Kind: instance method of RealmQuery

Param Type Description
fieldName string
value string
casing boolean CONTAINS[c] or CONTAINS

realmQuery.count() ⇒ number

Counts the number of objects that fulfill the query conditions

Kind: instance method of RealmQuery


realmQuery.distinct(fieldName) ⇒ Array.<any>

Returns a distinct set of objects of a specific class.

Kind: instance method of RealmQuery

Param Type
fieldName string

realmQuery.endsWith(fieldName, value, casing) ⇒ RealmQuery

Condition that the value of field ends with the specified string

Kind: instance method of RealmQuery

Param Type Description
fieldName string
value string
casing boolean ENDSWITH[c] or ENDSWITH

realmQuery.orEndsWith(fieldName, value, casing) ⇒ RealmQuery

OR Condition that the value of field ends with the specified string

Kind: instance method of RealmQuery

Param Type Description
fieldName string
value string
casing boolean ENDSWITH[c] or ENDSWITH

realmQuery.equalTo(fieldName, value) ⇒ RealmQuery

Equal-to comparaison

Kind: instance method of RealmQuery

Param Type
fieldName string
value EqualValueType

realmQuery.orEqualTo(fieldName, value) ⇒ RealmQuery

Or equal-to comparaison

Kind: instance method of RealmQuery

Param Type
fieldName string
value EqualValueType

realmQuery.findAll() ⇒ Realm.Results

Finds all objects that fulfill the query conditions

Kind: instance method of RealmQuery


realmQuery.findFirst() ⇒ Realm.Object

Finds the first object that fulfills the query conditions

Kind: instance method of RealmQuery


realmQuery.greaterThan(fieldName, value) ⇒ RealmQuery

Greater-than comparaison

Kind: instance method of RealmQuery

Param Type
fieldName string
value CompareValueType

realmQuery.orGreaterThan(fieldName, value) ⇒ RealmQuery

OR Greater-than comparaison

Kind: instance method of RealmQuery

Param Type
fieldName string
value CompareValueType

realmQuery.greaterThanOrEqualTo(fieldName, value) ⇒ RealmQuery

greater-than-or-equal-to comparaison

Kind: instance method of RealmQuery

Param Type
fieldName string
value CompareValueType

realmQuery.orGreaterThanOrEqualTo(fieldName, value) ⇒ RealmQuery

Or greater-than-or-equal-to comparaison

Kind: instance method of RealmQuery

Param Type
fieldName string
value CompareValueType

realmQuery.in(fieldName, values) ⇒ RealmQuery

In comparaison

Kind: instance method of RealmQuery

Param Type
fieldName string
values Array.<EqualValueType>

realmQuery.orIn(fieldName, values) ⇒ RealmQuery

Or in comparaison

Kind: instance method of RealmQuery

Param Type
fieldName string
values Array.<EqualValueType>

realmQuery.notIn(fieldName, values) ⇒ RealmQuery

not In comparaison

Kind: instance method of RealmQuery

Param Type
fieldName string
values Array.<EqualValueType>

realmQuery.orNotIn(fieldName, values) ⇒ RealmQuery

Or not in comparaison

Kind: instance method of RealmQuery

Param Type
fieldName string
values Array.<EqualValueType>

realmQuery.isNotNull(fieldName) ⇒ RealmQuery

not null comparaison

Kind: instance method of RealmQuery

Param Type
fieldName string

realmQuery.isNull(fieldName) ⇒ RealmQuery

null comparaison

Kind: instance method of RealmQuery

Param Type
fieldName string

realmQuery.lessThan(fieldName, value) ⇒ RealmQuery

Less-than comparaison

Kind: instance method of RealmQuery

Param Type
fieldName string
value CompareValueType

realmQuery.orLessThan(fieldName, value) ⇒ RealmQuery

or Less-than comparaison

Kind: instance method of RealmQuery

Param Type
fieldName string
value CompareValueType

realmQuery.lessThanOrEqualTo(fieldName, value) ⇒ RealmQuery

Less-than-or-equal-to comparaison

Kind: instance method of RealmQuery

Param Type
fieldName string
value CompareValueType

realmQuery.orLessThanOrEqualTo(fieldName, value) ⇒ RealmQuery

OR Less-than-or-equal-to comparaison

Kind: instance method of RealmQuery

Param Type
fieldName string
value CompareValueType

realmQuery.not() ⇒ RealmQuery

start a NOT operator

Kind: instance method of RealmQuery


realmQuery.endNot() ⇒ RealmQuery

end a NOT operator

Kind: instance method of RealmQuery


realmQuery.notEqualTo(fieldName, value) ⇒ RealmQuery

Not-equal-to comparaison

Kind: instance method of RealmQuery

Param Type
fieldName string
value EqualValueType

realmQuery.orNotEqualTo(fieldName, value) ⇒ RealmQuery

or Not-equal-to comparaison

Kind: instance method of RealmQuery

Param Type
fieldName string
value EqualValueType

realmQuery.beginGroup() ⇒ RealmQuery

Begin AND grouping of conditions ("left parenthesis")

Kind: instance method of RealmQuery


realmQuery.beginOrGroup() ⇒ RealmQuery

Begin OR grouping of conditions ("left parenthesis")

Kind: instance method of RealmQuery


realmQuery.endGroup() ⇒ RealmQuery

End grouping of conditions ("right parenthesis") which was opened by a call to beginGroup()

Kind: instance method of RealmQuery


realmQuery.group(cb) ⇒ RealmQuery

Group query in a callback

Kind: instance method of RealmQuery

Param Type
cb groupCallback

Example

query.group((groupQuery) => {
  return groupQuery
     .equalTo('field', 10)
     .orEqualTo('field2', 'value')
})

realmQuery.orGroup(cb) ⇒ RealmQuery

Group query in a callback with OR operator

Kind: instance method of RealmQuery

Param Type
cb groupCallback

Example

query.orGroup((groupQuery) => {
  return groupQuery
     .equalTo('field', 10)
     .orEqualTo('field2', 'value')
})

realmQuery.join(query) ⇒ RealmQuery

Combine to another query

Kind: instance method of RealmQuery

Param Type
query RealmQuery

realmQuery.orJoin(query) ⇒ RealmQuery

Combine to another query with OR operator

Kind: instance method of RealmQuery

Param Type
query RealmQuery

CompareValueType

Type
Date | Number

EqualValueType

Type
string | number | boolean | Date

groupCallback : function

Type
RealmQuery