reaves

Members

(static, constant) CASE_SENSITIVE :Number

Source:
Default Value:
  • 0b001

A flag that indicates whether the value comparisons should be case sensitive.

Type:
  • Number

(static, constant) NULLABLE :Number

Source:
Default Value:
  • 0b010

A flag that indicates whether the attribute is nullable.

Type:
  • Number

(static, constant) UNIQUE :Number

Source:
Default Value:
  • 0b100

A flag that indicates whether the value should be unique.

Type:
  • Number

Methods

(static) createEntityAttribute(client, entityName, attributeName, flags, done) → {EntityAttribute}

Source:

The asynchronous factory method.

Example
const { CASE_SENSITIVE, createdEntityAttribute, UNIQUE } = require('reaves')
const redis = require('redis')
const uuidv4 = require('uuid/v4')

const client = redis.createClient()
const entityName = 'player'
const attributeName = 'nickname'
const flags = CASE_SENSITIVE | UNIQUE

createEntityAttribute(client, entityName, attributeName, flags, (err, entityAttribute) => {
    // your code here
})
Parameters:
Name Type Description
client Object

The redis client.

entityName String

The name for the entity. It is an arbitrary string value that is used to namespace the underlying redis keys.

attributeName String

The name for the attribute. It is an arbitrary string value that is used to namespace the underlying redis keys.

flags Number

A flag or a combination of flags to configure the entity attribute. The available flags are CASE_SENSITIVE, NULLABLE and UNIQUE. They can be combined using the | operator.

done function

The final callback. Invoked with (err, entityAttribute).

Returns:
Type
EntityAttribute