Class WL.JSONStore.QueryPart
WL.JSONStore.QueryPart
- Description:
Descriptions and reference information for the WL.JSONStore.QueryPart API functions.
For an overview and more descriptive information, see the JSONStore overview section in the IBM® MobileFirst® user documentation.
Method Attributes | Method Name and Description |
---|---|
between(searchField, value)
Add a between clause to a query for advanced find.
|
|
equal(searchField, value)
Add an equal to clause to a query for advanced find.
|
|
greaterOrEqualThan(searchField, value)
Add a greater or equal thanclause to a query for advanced find.
|
|
greaterThan(searchField, value)
Add a greater than clause to a query for advanced find.
|
|
inside(searchField, value)
Add an in clause to a query for advanced find.
|
|
leftLike(searchField, value)
Add a left clause to a query for advanced find.
|
|
lessOrEqualThan(searchField, value)
Add a less or equal than clause to a query for advanced find.
|
|
lessThan(searchField, value)
Add a less than clause to a query for advanced find.
|
|
like(searchField, value)
Add a like clause to a query for advanced find.
|
|
notBetween(searchField, value)
Add a not between clause to a query for advanced find.
|
|
notEqual(searchField, value)
Add a not equal to clause to a query for advanced find.
|
|
notInside(searchField, value)
Add a not in clause to a query for advanced find.
|
|
notLeftLike(searchField, value)
Add a not left clause to a query for advanced find.
|
|
notLike(searchField, value)
Add a not like clause to a query for advanced find.
|
|
notRightLike(searchField, value)
Add a not right clause to a query for advanced find.
|
|
rightLike(searchField, value)
Add a right clause to a query for advanced find.
|
The between clause will make comparisons between the query and the documents in the collection and return documents(s) if the selected search field or additional search field values are between the range given by the query.
- Parameters:
- {string} searchField - Determines what search field or additional search field to use in the query.
- {array} value - The range of values, integer or number, to use in the query.
- Returns:
- {array} Returns a formatted query array.
- Example:
var arr = WL.JSONStore.QueryPart().between('gpa', [3.0, 4.0]); //arr = [{$between: [{ gpa : [3.0, 4.0] }]}]
Behaves like the exact option in WL.JSONStore.JSONStoreInstance.find
. See WL.JSONStore.JSONStoreInstance.find
for more information.
- Parameters:
- {string} searchField - Determines what search field or additional search field to use in the query.
- {string|integer|number} value - Determines what value to use to compare in the query.
- Returns:
- {array} Returns a formatted query array.
- Example:
var arr = WL.JSONStore.QueryPart().equal('age', 35); //arr = [{$equal: [{ age : 35 }]}]
The greater than equal clause will make comparisons between the query and the documents in the collection and return document(s) if the selected search field or additional search field values are greater than or equal to the value given by the query.
- Parameters:
- {string} searchField - Determines what search field or additional search field to use in the query.
- {integer|number} value - Determines what value to use in the query.
- Returns:
- {array} Returns a formatted query array.
- Example:
var arr = WL.JSONStore.QueryPart().greaterOrEqualThan('age', 40); //arr = [{$greaterOrEqualThan: [{ age : 40 }]}]
The greater than clause will make comparisons between the query and the document in the collection and return document(s) if the selected search field or additional search field values are greater than the value given by the query.
- Parameters:
- {string} searchField - Determines what search field or additional search field to use in the query.
- {integer|number} value - Determines what value to use in the query.
- Returns:
- {array} Returns a formatted query array.
- Example:
var arr = WL.JSONStore.QueryPart().greaterThan('age', 40); //arr = [{$greaterThan: [{ age : 40 }]}]
The in clause with make comparisons between the query and the documents in the collection and return document(s) if the selected search field or additional search field values given by the query are contained in the document.
- Parameters:
- {string} searchField - Determines what search field or additional search field to use in the query.
- {array} value - The range of values to use in the query.
- Returns:
- {array} Returns a formatted query array.
- Example:
var arr = WL.JSONStore.QueryPart().inside('gpa', [3.0, 4.0]); //arr = [{$inside: [{ gpa : [3.0, 4.0] }]}]
Similar to WL.JSONStore.QueryPart.like
except only use input from the left.
See WL.JSONStore.Query.like
for more information.
- Parameters:
- {string} searchField - Determines what search field or additional search field to use in the query.
- {string} value - Determines what string value to use to compare in the query.
- Returns:
- {array} Returns a formatted query array.
- Example:
var arr = WL.JSONStore.QueryPart().leftLike('name', 'ca'); //arr = [{$leftLike: [{ name : 'ca' }]}]
The less than equal clause will make comparisons between the query and the document in the collection and return document(s) if the selected search field or additional search field value are less than or equal to the value given by the query.
- Parameters:
- {string} searchField - Determines what search field or additional search field to use in the query.
- {integer|number} value - Determines what value to use in the query.
- Returns:
- {array} Returns a formatted query array.
- Example:
var arr = WL.JSONStore.QueryPart().lessOrEqualThan('age', 40); //arr = [{$lessOrEqualThan: [{ age : 40 }]}]
The less than clause will make comparisons between the query and the document in the collection and return document(s) if the selected search field or additional search field value are less than the value given by the query.
- Parameters:
- {string} searchField - Determines what search field or additional search field to use in the query.
- {integer|number} value - Determines what value to use in the query.
- Returns:
- {array} Returns a formatted query array.
- Example:
var arr = WL.JSONStore.QueryPart().lessThan('age', 40); //arr = [{$lessThan: [{ age : 40 }]}]
Behaves like the fuzzy option in WL.JSONStore.JSONStoreInstance.find
. See WL.JSONStore.JSONStoreInstance.find
for more information.
- Parameters:
- {string} searchField - Determines what search field or additional search field to use in the query.
- {string} value - Determines what string value to use to compare in the query.
- Returns:
- {array} Returns a formatted query array.
- Example:
var arr = WL.JSONStore.QueryPart().like('name', 'ca'); //arr = [{$like: [{ name : 'ca' }]}]
The negative of between. See WL.JSONStore.QueryPart.between
for more information.
- Parameters:
- {string} searchField - Determines what search field or additional search field to use in the query.
- {array} value - The range of values, integer or number, to use in the query.
- Returns:
- {array} Returns a formatted query array.
- Example:
var arr = WL.JSONStore.QueryPart().notBetween('gpa', [3.0, 4.0]); //arr = [{$notBetween: [{ gpa : [3.0, 4.0] }]}]
The negative of equal. See WL.JSONStore.QueryPart.equal
for more information.
- Parameters:
- {string} searchField - Determines what search field or additional search field to use in the query.
- {string} value - Determines what string value to use in the query.
- Returns:
- {array} Returns a formatted query array.
- Example:
var arr = WL.JSONStore.QueryPart().notEqual('name', 'ca'); //arr = [{$notEqual: [{ name : 'ca' }]}]
The negative of in. See WL.JSONStore.QueryPart.inside
for more information.
- Parameters:
- {string} searchField - Determines what search field or additional search field to use in the query.
- {array} value - The range of values to use in the query.
- Returns:
- {array} Returns a formatted query array.
- Example:
var arr = WL.JSONStore.QueryPart().notBetween('gpa', [3.0, 4.0]); //arr = [{$notBetween: [{ gpa : [3.0, 4.0] }]}]
The negative of left like. See WL.JSONStore.QueryPart.leftLike
for more information.
- Parameters:
- {string} searchField - Determines what search field or additional search field to use in the query.
- {string} value - Determines what string value to use to compare in the query.
- Returns:
- {array} Returns a formatted query array.
- Example:
var arr = WL.JSONStore.QueryPart().notLeftLike('name', 'ca'); //arr = [{$notLeftLike: [{ name : 'ca' }]}]
The negative of like. See WL.JSONStore.QueryPart.like
for more information.
- Parameters:
- {string} searchField - Determines what search field or additional search field to use in the query.
- {string} value - Determines what string value to use to compare in the query.
- Returns:
- {array} Returns a formatted query array.
- Example:
var arr = WL.JSONStore.QueryPart().notLike('name', 'ca'); //arr = [{$notLike: [{ name : 'ca' }]}]
The negative of right like. See WL.JSONStore.QueryPart.rightLike
for more information.
- Parameters:
- {string} searchField - Determines what search field or additional search field to use in the query.
- {string} value - Determines what string value to use to compares in the query.
- Returns:
- {array} Returns a formatted query array.
- Example:
var arr = WL.JSONStore.QueryPart().notRightLike('name', 'ca'); //arr = [{$notRightLike: [{ name : 'ca' }]}]
Similar to WL.JSONStore.QueryPart.like
except only use input from the right.
See WL.JSONStore.QueryPart.like
for more information.
- Parameters:
- {string} searchField - Determines what search field or additional search field to use in the query.
- {string} value - Determines what string value to use to compare in the query.
- Returns:
- {array} Returns a formatted query array.
- Example:
var arr = WL.JSONStore.QueryPart().rightLike('name', 'ca'); //arr = [{$rightLike: [{ name : 'ca' }]}]