Modules.Cloud.KeyValues
> Modules.Cloud.KeyValues

Provides methods for accessing ArrowDB Key-Values storage.

Examples

Set a Key-Value

This example sets a key-value and checks the response.

Cloud.KeyValues.set({
    name: 'welcome_message',
    value: 'Welcome to Appcelerator Cloud Services'
}, function (e) {
    if (e.success) {
        alert('Success');
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Get a Key-Value

This example gets a key-value and checks the response.

Cloud.KeyValues.get({
    name: 'welcome_message'
}, function (e) {
    if (e.success) {
        var keyvalue = e.keyvalues[0];
        alert('Success:\n' +
            'name: ' + keyvalue.name + '\n' +
            'value: ' + keyvalue.value);
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Append a Key-Value

This example appends a value to a key-value and checks the response.

Cloud.KeyValues.append({
    name: 'welcome_message',
    value: ', take a look around'
}, function (e) {
     if (e.success) {
         var keyvalue = e.keyvalues[0];
         alert('Success:\n' +
             'name: ' + keyvalue.name + '\n' +
             'value: ' + keyvalue.value);
     } else {
         alert('Error:\n' +
             ((e.error && e.message) || JSON.stringify(e)));
     }

});

Increment a Key-Value

This example increments a key-value and checks the response.

Cloud.KeyValues.increment({
    name: 'score',
    value: 1
}, function (e) {
     if (e.success) {
         var keyvalue = e.keyvalues[0];
         alert('Success:\n' +
             'name: ' + keyvalue.name + '\n' +
             'value: ' + keyvalue.value);
     } else {
         alert('Error:\n' +
             ((e.error && e.message) || JSON.stringify(e)));
     }

});

Remove a Key-Value

This example deletes a key-value and checks the response.

Cloud.KeyValues.remove({
    name: 'welcome_message'
}, function (e) {
     if (e.success) {
         alert('Success');
     } else {
         alert('Error:\n' +
             ((e.error && e.message) || JSON.stringify(e)));
     }

});
  • 0.8
  • 0.8
  • 0.8
Defined By

Properties

apiName : Stringreadonly

The name of the API that this proxy corresponds to.

The name of the API that this proxy corresponds to.

The value of this property is the fully qualified name of the API. For example, Button returns Ti.UI.Button.

  • 3.2.0
  • 3.2.0
  • 3.2.0
Indicates if the proxy will bubble an event to its parent. ...

Indicates if the proxy will bubble an event to its parent.

Some proxies (most commonly views) have a relationship to other proxies, often established by the add() method. For example, for a button added to a window, a click event on the button would bubble up to the window. Other common parents are table sections to their rows, table views to their sections, and scrollable views to their views. Set this property to false to disable the bubbling to the proxy's parent.

Default: true

  • 3.0.0
  • 3.0.0
  • 3.0.0

The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.

The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.

If this property is set to a Window or TabGroup, then the corresponding Activity lifecycle event callbacks will also be called on the proxy. Proxies that require the activity lifecycle will need this property set to the appropriate containing Window or TabGroup.

  • 3.6.0
Defined By

Methods

Modules.Cloud.KeyValues
( parameters, callback )
Add the given value to the end of an existing value. ...

Add the given value to the end of an existing value.

Requires user login.

See Key-Values: Append to a Key-Value for the request parameters supported by this method.

Not allowed on keyvalues with binary data.

Data is returned in the keyvalues property of the parameter passed to the callback.

Parameters

Returns

  • void
Applies the properties to the proxy. ...

Applies the properties to the proxy.

Properties are supplied as a dictionary. Each key-value pair in the object is applied to the proxy such that myproxy[key] = value.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Parameters

  • props : Dictionary

    A dictionary of properties to apply.

Returns

  • void
Modules.Cloud.KeyValues
( parameters, callback )
Retrieve a string or binary value. ...

Retrieve a string or binary value.

See Key-Value Store: Get a Value for the request parameters supported by this method.

Data is returned in the keyvalues property of the parameter passed to the callback.

Parameters

Returns

  • void
Gets the value of the apiName property. ...

Gets the value of the apiName property.

  • 3.2.0
  • 3.2.0
  • 3.2.0

Returns

  • String
Gets the value of the bubbleParent property. ...

Gets the value of the bubbleParent property.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Returns

  • Boolean
Gets the value of the lifecycleContainer property. ...

Gets the value of the lifecycleContainer property.

  • 3.6.0

Returns

Modules.Cloud.KeyValues
( parameters, callback )
Increment the value by the given value. ...

Increment the value by the given value.

Requires user login.

See Key-Values: Increment a Key-Value for the request parameters supported by this method.

Not allowed on keyvalues with binary data.

Data is returned in the keyvalues property of the parameter passed to the callback.

Parameters

Returns

  • void
Modules.Cloud.KeyValues
( parameters, callback )
Delete a value. ...

Delete a value.

Requires user login.

See Key-Values: Delete a Key-Value for the request parameters supported by this method.

Parameters

Returns

  • void
Modules.Cloud.KeyValues
( parameters, callback )
Sets a string or binary value referenced by the key name. ...

Sets a string or binary value referenced by the key name.

Requires user login.

See Key-Value Storage: Set a string or binary value for the request parameters supported by this method.

Parameters

Returns

  • void
Sets the value of the bubbleParent property. ...

Sets the value of the bubbleParent property.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Parameters

  • bubbleParent : Boolean

    New value for the property.

Returns

  • void
Sets the value of the lifecycleContainer property. ...

Sets the value of the lifecycleContainer property.

  • 3.6.0

Parameters

Returns

  • void