NCMBQuery

class NCMBQuery<T : NCMBObject>

Query handling class.

NCMBQuery is used to set search conditions, to search data from NIFCLOUD mobile backend.

Types

Companion
Link copied to clipboard
object Companion

Functions

addOrderByAscending
Link copied to clipboard
fun addOrderByAscending(key: String)

Set the conditions to search the data by ascending order with specified field name (key)

addOrderByDescending
Link copied to clipboard
fun addOrderByDescending(key: String)

Set the conditions to search the data by descending order with specified field name (key)

count
Link copied to clipboard
fun count(): Int

Get total number of search result from NIFCLOUD mobile backend

countInBackground
Link copied to clipboard
fun countInBackground(countCallback: NCMBCallback)

Get total number of search result from NIFCLOUD mobile backend asynchronously

find
Link copied to clipboard
fun find(): List<T>

Search data from NIFCLOUD mobile backend

findInBackground
Link copied to clipboard
fun findInBackground(findCallback: NCMBCallback)

Search data from NIFCLOUD mobile backend asynchronously

or
Link copied to clipboard
fun or(queries: Collection<NCMBQuery<*>>)

Set the OR conditions to search the data that matches any one of the given query

whereContainedIn
Link copied to clipboard
fun whereContainedIn(key: String, objects: Collection<Any>)

Set the conditions to search the data that contains value of the specified key

whereContainedInArray
Link copied to clipboard
fun whereContainedInArray(key: String, objects: Collection<Any>)

Set the conditions to search the data that contains elements of array in the specified key

whereContainsAll
Link copied to clipboard
fun whereContainsAll(key: String, elements: Collection<Any>)

Set the conditions to search the data that contains all elements of array in the specified key

whereEqualTo
Link copied to clipboard
fun whereEqualTo(key: String, value: Any)

Set the conditions to search the data that matches the value of the specified key. NOTICE that if this search condition is set, you can not set other search condition for this key. OR if this search condition is set last, other set search condition for same key will be overwrite.

whereGreaterThan
Link copied to clipboard
fun whereGreaterThan(key: String, value: Any)

Set the conditions to search the data that greater than the value of the specified key

whereGreaterThanOrEqualTo
Link copied to clipboard
fun whereGreaterThanOrEqualTo(key: String, value: Any)

Set the conditions to search the data that greater than or equal to the value of the specified key

whereLessThan
Link copied to clipboard
fun whereLessThan(key: String, value: Any)

Set the conditions to search the data that less than the value of the specified key

whereLessThanOrEqualTo
Link copied to clipboard
fun whereLessThanOrEqualTo(key: String, value: Any)

Set the conditions to search the data that less than or equal to the value of the specified key

whereNearSphere
Link copied to clipboard
fun whereNearSphere(key: String, centerLocation: NCMBGeoPoint)

Set the conditions to search the data with location information, return data order by from near to far order, based on distance from centerLocation.

whereNearSphereKilometers
Link copied to clipboard
fun whereNearSphereKilometers(key: String, centerLocation: NCMBGeoPoint, maxDistance: Double)

Set the conditions to search the data with location information, return data order by from near to far order, based on distance from centerLocation.

whereNearSphereMiles
Link copied to clipboard
fun whereNearSphereMiles(key: String, centerLocation: NCMBGeoPoint, maxDistance: Double)

Set the conditions to search the data with location information, return data order by from near to far order, based on distance from centerLocation.

whereNearSphereRadians
Link copied to clipboard
fun whereNearSphereRadians(key: String, centerLocation: NCMBGeoPoint, maxDistance: Double)

Set the conditions to search the data with location information, return data order by from near to far order, based on distance from centerLocation.

whereNotContainedIn
Link copied to clipboard
fun whereNotContainedIn(key: String, objects: Collection<Any>)

Set the conditions to search the data that not contains value of the specified key

whereNotContainedInArray
Link copied to clipboard
fun whereNotContainedInArray(key: String, objects: Collection<Any>)

Set the conditions to search the data that contains elements of array in the specified key

whereNotEqualTo
Link copied to clipboard
fun whereNotEqualTo(key: String, value: Any)

Set the conditions to search the data that does not match the value of the specified key

whereWithinGeoBox
Link copied to clipboard
fun whereWithinGeoBox(key: String, southwest: NCMBGeoPoint, northeast: NCMBGeoPoint)

Set the conditions to search the data with location information

Properties

limit
Link copied to clipboard
var limit: Int = 0

Limit search operator (default value is 0 (valid limit value is 1 to 1000))

mClassName
Link copied to clipboard
val mClassName: String
query
Link copied to clipboard
val query: JSONObject

Get current search condition

service
Link copied to clipboard
val service: NCMBServiceInterface<T>
skip
Link copied to clipboard
var skip: Int = 0

Skip search operator (default value is 0 (valid skip value is >0 ))