Documentation

LeanRedis.Client.Generic

def LeanRedis.Client.copy {τ : Type} [Transport.Transport τ] (client : Client τ) (source destination : String) (options : CopyOptions := { }) :

Copy a key to a new key.

Example:

let copied ← client.copy "src" "dst"
Equations
  • One or more equations did not get rendered due to their size.
Instances For

    Delete one or more keys.

    Example:

    let removed ← client.del #["key1", "key2"]
    
    Equations
    Instances For

      Dump a serialised version of the value stored at a key.

      Example:

      let serialized ← client.dump "key"
      
      Equations
      Instances For

        Determine whether one or more keys exist.

        Example:

        let count ← client.exists #["key1", "key2"]
        
        Equations
        Instances For

          Set a key's time to live in seconds.

          Example:

          let set ← client.expire "key" 60
          
          Equations
          Instances For

            Set a key's time to live as a Unix timestamp in seconds.

            Example:

            let set ← client.expireAt "key" timestamp
            
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              Get the expiration time of a key as a Unix timestamp in seconds.

              Example:

              let ts ← client.expireTime "key"
              
              Equations
              Instances For

                Find all keys matching the given pattern.

                Example:

                let keys ← client.keys "user:*"
                
                Equations
                Instances For
                  def LeanRedis.Client.move {τ : Type} [Transport.Transport τ] (client : Client τ) (key : String) (destinationDb : UInt32) :

                  Move a key to another database.

                  Example:

                  let moved ← client.move "key" 1
                  
                  Equations
                  Instances For

                    Get the internal encoding of a key's value.

                    Example:

                    let encoding ← client.objectEncoding "key"
                    
                    Equations
                    Instances For

                      Get the logarithmic access frequency counter of a key's value.

                      Example:

                      let freq ← client.objectFreq "key"
                      
                      Equations
                      Instances For

                        Get the idle time of a key in seconds.

                        Example:

                        let idle ← client.objectIdleTime "key"
                        
                        Equations
                        Instances For

                          Get the reference count of a key's value.

                          Example:

                          let refcount ← client.objectRefCount "key"
                          
                          Equations
                          Instances For

                            Remove the expiration from a key.

                            Example:

                            let removed ← client.persist "key"
                            
                            Equations
                            Instances For
                              def LeanRedis.Client.pexpire {τ : Type} [Transport.Transport τ] (client : Client τ) (key : String) (milliseconds : UInt64) (option : Option ExpireOption := none) :

                              Set a key's time to live in milliseconds.

                              Example:

                              let set ← client.pexpire "key" 5000
                              
                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For

                                Set a key's time to live as a Unix timestamp in milliseconds.

                                Example:

                                let set ← client.pexpireAt "key" timestamp
                                
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For

                                  Get the time to live for a key in milliseconds.

                                  Example:

                                  let ttl ← client.pttl "key"
                                  
                                  Equations
                                  Instances For

                                    Return a random key from the keyspace.

                                    Example:

                                    let key ← client.randomKey
                                    
                                    Equations
                                    Instances For

                                      Rename a key.

                                      Example:

                                      let _ ← client.rename "old" "new"
                                      
                                      Equations
                                      Instances For

                                        Rename a key only when the target key does not exist.

                                        Example:

                                        let renamed ← client.renameNx "old" "new"
                                        
                                        Equations
                                        Instances For
                                          def LeanRedis.Client.restore {τ : Type} [Transport.Transport τ] (client : Client τ) (key : String) (ttl : UInt64) (serializedValue : String) (options : RestoreOptions := { }) :

                                          Restore a serialised value previously obtained with DUMP.

                                          Example:

                                          let _ ← client.restore "key" 0 serialized
                                          
                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For

                                            Incrementally iterate the keyspace.

                                            Example:

                                            let page ← client.scan 0
                                            
                                            Equations
                                            Instances For

                                              Sort the elements in a list, set, or sorted set.

                                              NOTE: When using the store? option, Redis returns the number of stored elements rather than the sorted array. This method expects an array reply; use execute directly when STORE is specified.

                                              Example:

                                              let elements ← client.sort "mylist"
                                              
                                              Equations
                                              Instances For

                                                Sort the elements in a list, set, or sorted set (read‑only variant).

                                                Example:

                                                let elements ← client.sortRo "mylist"
                                                
                                                Equations
                                                Instances For

                                                  Touch one or more keys, updating their access time.

                                                  Example:

                                                  let touched ← client.touch #["key1", "key2"]
                                                  
                                                  Equations
                                                  Instances For

                                                    Get the time to live for a key in seconds.

                                                    Example:

                                                    let ttl ← client.ttl "key"
                                                    
                                                    Equations
                                                    Instances For

                                                      Determine the type of the value stored at a key.

                                                      Example:

                                                      let type ← client.type "key"
                                                      
                                                      Equations
                                                      Instances For