Skip to content

Latest commit

 

History

History
73 lines (45 loc) · 1.72 KB

README.md

File metadata and controls

73 lines (45 loc) · 1.72 KB

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