domain~ UserMetadataFilter

A filter criteria object for user metadata.

This filter is used to query user metadata.

Constructor

new UserMetadataFilter(propsopt)

Constructor.

Parameters:
NameTypeAttributesDescription
propsobject<optional>

initial property values

Extends

Members

props :object

The object that all properties are stored on.

Type:
  • object

tags :Array.<string>

An array of tags.

Type:
  • Array.<string>

userId :number

A user ID.

This manages the first available location ID from the userIds property.

Type:
  • number

userIds :Array.<number>

An array of user IDs.

Type:
  • Array.<number>

Methods

prop(key, newValueopt) → {*}

Get, set, or remove a property value.

Parameters:
NameTypeAttributesDescription
keystring

the key to get or set the value for

newValue*<optional>

if defined, the new value to set for the given key; if null then the key property will be removed

Returns:

if called as a getter, the associated value for the given key, otherwise this object

Type: 
*

properties(newPropsopt) → {object}

Get, set, or remove multiple properties.

Parameters:
NameTypeAttributesDescription
newPropsobject<optional>

the new values to set; if any value is null that property will be deleted

Returns:

if called as a getter, all properties of this object copied into a simple object; otherwise this object

Type: 
object

toUriEncoding(propertyNameopt, callbackFnopt) → {string}

Get this object as a standard URI encoded (query parameters) string value.

All enumerable properties of the props property will be added to the result. If any property value is an array, the values of the array will be joined by a comma. Any module:util~Enum values will have their name property used. Any value that has a toUriEncoding() function property will have that function invoked, passing the associated property name as the first argument, and the returned value will be used.

Parameters:
NameTypeAttributesDescription
propertyNamestring<optional>

an optional object property prefix to add to all properties

callbackFnfunction<optional>

An optional function that will be called for each property. The function will be passed property name and value arguments, and must return either null to skip the property, a 2 or 3-element array with the property name and value to use, and an optional boolean to force array values to use mutliple parameter keys. Any other return value causes the property to be used as- is.

Returns:

the URI encoded string

Type: 
string

toUriEncodingWithSorting(sortsopt, paginationopt, propertyNameopt, callbackFnopt) → {string}

Get this object as a standard URI encoded (query parameters) string value with sorting and pagination parameters.

This calls module:util~PropMap#toUriEncoding first, then encodes the `sorts` and `pagination` parameters, if provided.

Parameters:
NameTypeAttributesDescription
sortsArray.<module:domain~SortDescriptor><optional>

optional sort settings to use

paginationmodule:domain~Pagination<optional>

optional pagination settings to use

propertyNamestring<optional>

an optional object property prefix to add to all properties

callbackFnfunction<optional>

An optional function that will be called for each property. The function will be passed property name and value arguments, and must return either null to skip the property, a 2-element array with the property name and value to use, or anything else to use the property as- is.

Returns:

the URI encoded string

Type: 
string