Skip to content

DioneB/fivem_redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Banner

A RedisDB Wrapper for FiveM

APIWikiLicenseRoadmapContribute

vRP Version

vRP Version

API

How to use FiveM_Redis API

[[Get Redis Reference]]

local Cache = exports.fivem_redis:GetInterface();

[[Methods]]

-- Save data on Redis Cache | if not "expire_time" passed they will persistent
Cache.Save(key, value, expire_time)

-- Get data from Redis Cache
Cache.Get(key, function(result)
  print(result)
end)

-- Remove data with informed key from Redis Cache
Cache.Invalidate(key)

-- Invalidate all data with informed prefix from Redis Cache
Cache.InvalidatePrefix(prefix, function(result)
  print(result)
end)


-- Save an Sorted Data | (key,data - [array])
Cache.ZAdd("sortedSet",{1, "um", 2, "dois", 4, "quatro", 3, "três"})

-- Get an Saved Sorted Data | (key,range_min,range_max,arg)
Cache.ZRange("sortedSet", 0, 2, "WITHSCORES", function(result)
  print(result)
  -- ["um", "1", "dois", "2", "três", "3"] como se o comando fosse `redis> ZRANGE sortedSet 0 2 WITHSCORES`
end)

Wiki

Roadmap

  • Find on our roadmap the next steps of the project.

Contribute

About

RedisDB Wrapper for FiveM

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 3

  •  
  •  
  •