Skip navigation links

Index Overview

PREV CLASS NEXT CLASS FRAMES (opens in new window)



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 Summary
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.

Method Detail

between

{array} between(searchField, value)

Add a between 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] }]}]


equal

{array} equal(searchField, value)

Add an equal to clause to a query for advanced find.

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 }]}]


greaterOrEqualThan

{array} greaterOrEqualThan(searchField, value)

Add a greater or equal thanclause to a query for advanced find.

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 }]}]


greaterThan

{array} greaterThan(searchField, value)

Add a greater than clause to a query for advanced find.

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 }]}]


inside

{array} inside(searchField, value)

Add an in clause to a query for advanced find.

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] }]}]


leftLike

{array} leftLike(searchField, value)

Add a left clause to a query for advanced find.

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' }]}]


lessOrEqualThan

{array} lessOrEqualThan(searchField, value)

Add a less or equal than clause to a query for advanced find.

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 }]}]


lessThan

{array} lessThan(searchField, value)

Add a less than clause to a query for advanced find.

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 }]}]


like

{array} like(searchField, value)

Add a like clause to a query for advanced find.

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' }]}]


notBetween

{array} notBetween(searchField, value)

Add a not between clause to a query for advanced find.

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] }]}]


notEqual

{array} notEqual(searchField, value)

Add a not equal to clause to a query for advanced find.

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' }]}]


notInside

{array} notInside(searchField, value)

Add a not in clause to a query for advanced find.

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] }]}]


notLeftLike

{array} notLeftLike(searchField, value)

Add a not left clause to a query for advanced find.

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' }]}]


notLike

{array} notLike(searchField, value)

Add a not like clause to a query for advanced find.

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' }]}]


notRightLike

{array} notRightLike(searchField, value)

Add a not right clause to a query for advanced find.

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' }]}]


rightLike

{array} rightLike(searchField, value)

Add a right clause to a query for advanced find.

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' }]}]


© Copyright IBM Corp. 2011, 2016.