Members
(static, constant) CASE_SENSITIVE :Number
A flag that indicates whether the value comparisons should be case sensitive.
Type:
- Number
(static, constant) NULLABLE :Number
A flag that indicates whether the attribute is nullable.
Type:
- Number
(static, constant) UNIQUE :Number
A flag that indicates whether the value should be unique.
Type:
- Number
Methods
(static) createEntityAttribute(client, entityName, attributeName, flags, done) → {EntityAttribute}
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 |
done |
function | The final callback. Invoked with |
Returns:
- Type
- EntityAttribute