1 Redis
Class Ax.redis.Redis
Holds an instance to Redis client
Constructor Summary
Method | Description |
---|---|
JSRedis(String code) | Allow getting a Redis client for the provided code. |
JSRedis(String host, int port) | Allow getting a Redis client for the specified hostname/port. |
JSRedis(String master, String[] sentinels, int timeout, String password) | Allow getting a Redis client for the specified Redis Sentinel service list. |
Method Summary
Modifier and Type | Method | Description |
---|---|---|
boolean | addAlias(String index, String name) | |
long | addSynonym(String index, String[] terms) | |
long | del(String[] keys) | |
long | delete(String pattern) | |
boolean | deleteAlias(String index, String name) | |
String | escape(String query) | |
boolean | exists(String code) | Allow knowing if a particular the Redis code exists. |
int | getNumActive() | |
int | getNumIdle() | |
int | getNumWaiters() | |
RediSearchClient | getRediSearch(String indexName) | |
String | hget(String key, String field) | |
Map | hgetAll(String key) | WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! perque no es un map ?? Nashorn ha de funcionar amb un map. |
long | hset(String key, String field, String value) | |
boolean | isReady() | |
String | ping() | |
String | ping(String msg) | |
long | pipeline(Consumer<redis.clients.jedis.Pipeline> consumer) | |
long | sadd(String key, String[] members) | |
io.redisearch.SearchResult | search(String index, String query, Consumer<io.redisearch.Query> options) | Ax. |
boolean | sismember(String key, String member) | |
String[] | smembers(String key) | |
List | sugget(String index, String prefix) | Ax. |
List | sugget(String index, String prefix, int max) | |
List | sugget(String index, String prefix, boolean fuzzy) | |
List | sugget(String index, String prefix, boolean fuzzy, int max) | |
List | sugget(String index, String prefix, boolean fuzzy, boolean scores, boolean payload, int max) | |
Long | suglen(String index) | |
long | sunionstore(String dstkey, String[] keys) | |
String | toString() | Return JedisClient toString() |
boolean | updateAlias(String index, String name) | |
boolean | updateSynonym(String index, long synonymGroupId, String[] terms) | |
boolean | updateSynonym(String index, String synonymGroupId, String[] terms) | |
long | zadd(String key, String subkey, String member) | |
long | zadd(String key, double score, String member) | |
double | zincrby(String key, double increment, String member) | |
String[] | zrange(String key, long start, long stop) | |
long | zrem(String key, String member) | |
String[] | zrevrangeByScore(String key, double max, double min) | |
String[] | zrevrangeByScore(String key, double max, double min, int offset, int count) | |
long | zrevrank(String key, String member) | |
long | zunionstore(String key, String[] sets) |
Method Detail
JSRedis
-
JSRedis(String code)
- Info:
-
Allow getting a Redis client for the provided code. - Parameters:
- code -
Example
Copy
var client = new Ax.redis.Redis("REDIS1"); console.log(client.isReady());
JSRedis
-
JSRedis(String host, int port)
- Info:
-
Allow getting a Redis client for the specified hostname/port. - Parameters:
- host -
- port -
Example
Copy
var client = new Ax.redis.Redis("192.168.105.173", 6379); console.log(client.isReady());
JSRedis
-
JSRedis(String master, String[] sentinels, int timeout, String password)
- Info:
-
Allow getting a Redis client for the specified Redis Sentinel service list. Will be used when an AX JavaScript program wants to use a specific sentinel services list (not the ones configured in Studio, for example). - Parameters:
- master -
- sentinels -
- timeout -
- password -
Example
Copy
var client = new Ax.redis.Redis("master1", ["192.168.105.174:8001", "192.168.105.174:8002", "192.168.105.174:8003"], 60, null); console.log('client is ready? ' + client.isReady()) client.ping(); client.sadd("key_4", ["val_44"]);
del
-
long del(String[] keys)
- Parameters:
- keys -
- Returns:
delete
-
long delete(String pattern)
- Parameters:
- pattern -
- Returns:
exists
-
boolean exists(String code)
- Info:
-
Allow knowing if a particular the Redis code exists. - Parameters:
- code -
- Returns:
- allows javascript to determine if a Redis instance may be created before trying to create an instance of Ax.redis.Redis(). <pre> let code = 'myRedis1'; if (Ax.redis.Redis.exists(code)) { console.log('exists Redis with code ' + code); } </pre>
Example
Copy
let code = 'myRedis1'; if (Ax.redis.Redis.exists(code)) { console.log('exists Redis with code ' + code); }
getNumActive
-
int getNumActive()
- Returns:
getNumIdle
-
int getNumIdle()
- Returns:
getNumWaiters
-
int getNumWaiters()
- Returns:
getRediSearch
-
RediSearchClient getRediSearch(String indexName)
- Parameters:
- indexName -
- Returns:
hgetAll
-
Map hgetAll(String key)
- Info:
-
WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! WARNING: aixo no pot ser un objecte de Nashorn!!! perque no es un map ?? Nashorn ha de funcionar amb un map... - Parameters:
- key -
- Returns:
- a json object with all the key & values
isReady
-
boolean isReady()
- Returns:
- if Redis server is ready (checked with ping command)
ping
-
String ping()
- Returns:
pipeline
-
long pipeline(Consumer<redis.clients.jedis.Pipeline> consumer)
- Parameters:
- consumer -
- Returns:
search
sugget
-
List sugget(String index, String prefix)
- Info:
-
Ax.ext.db.getRedisClient().sugget("sug_test", "pilota"); Ax.ext.db.getRedisClient().sugget("sug_test", "pilota", 10); Ax.ext.db.getRedisClient().sugget("sug_test", "pilota", true); Ax.ext.db.getRedisClient().sugget("sug_test", "pilota", true, 10); //fuzzy //scores //payload //max Ax.ext.db.getRedisClient().sugget("sug_test", "pilota", true, false, true, 10); - Parameters:
- index -
- prefix -
- Returns:
sugget
sugget
sugget
sugget
toString
-
String toString()
- Info:
-
Return JedisClient toString() - Returns:
updateSynonym
updateSynonym
zadd
zincrby
zrevrangeByScore
zrevrangeByScore
2 Redisearch
2.1 AggregationBuilder
AggregationBuilder documentation page.
2.2 SortedField
SortedField documentation page.