Documentation

LeanRedis.Client.String

Get the value of a string key.

Example:

let value ← client.get "key"
Equations
Instances For
    def LeanRedis.Client.set {τ : Type} [Transport.Transport τ] (client : Client τ) (key value : String) (options : SetOptions := { }) :

    Set a string key with optional SET modifiers.

    Example:

    let stored ← client.set "key" "value"
    let storedNx ← client.set "key" "value" { condition? := some .nx }
    
    Equations
    Instances For

      Get multiple string keys with nullable results.

      Example:

      let values ← client.mGet #["a", "b"]
      
      Equations
      Instances For

        Set multiple string entries with MSET.

        Example:

        let _ ← client.mSet #[("a", "1"), ("b", "2")]
        
        Equations
        Instances For

          Set multiple string entries only if all keys are absent.

          Example:

          let stored ← client.mSetNx #[("a", "1"), ("b", "2")]
          
          Equations
          Instances For

            Get and delete a string key.

            Example:

            let previous ← client.getDel "key"
            
            Equations
            Instances For

              Get a string key and optionally update its expiration.

              Example:

              let value ← client.getEx "key" (some <| .persist)
              
              Equations
              Instances For

                Read a substring from a string value.

                Example:

                let part ← client.getRange "key" 0 4
                
                Equations
                Instances For

                  Replace a string value and return the previous one.

                  Example:

                  let previous ← client.getSet "key" "next"
                  
                  Equations
                  Instances For
                    def LeanRedis.Client.setRange {τ : Type} [Transport.Transport τ] (client : Client τ) (key : String) (offset : UInt64) (value : String) :

                    Overwrite part of a string starting at the given offset.

                    Example:

                    let size ← client.setRange "key" 2 "xy"
                    
                    Equations
                    Instances For

                      Return the length of a string value.

                      Example:

                      let len ← client.strLen "key"
                      
                      Equations
                      Instances For

                        Append text to a string value.

                        Example:

                        let len ← client.append "key" "suffix"
                        
                        Equations
                        Instances For

                          Increment a string integer value by one.

                          Example:

                          let value ← client.incr "counter"
                          
                          Equations
                          Instances For

                            Increment a string integer value by the given amount.

                            Example:

                            let value ← client.incrBy "counter" 5
                            
                            Equations
                            Instances For

                              Increment a string numeric value by a decimal amount.

                              Example:

                              let value ← client.incrByFloat "score" "1.5"
                              
                              Equations
                              Instances For

                                Decrement a string integer value by one.

                                Example:

                                let value ← client.decr "counter"
                                
                                Equations
                                Instances For

                                  Decrement a string integer value by the given amount.

                                  Example:

                                  let value ← client.decrBy "counter" 3
                                  
                                  Equations
                                  Instances For

                                    Set a string value only if the key does not exist.

                                    Example:

                                    let stored ← client.setNx "key" "value"
                                    
                                    Equations
                                    Instances For
                                      def LeanRedis.Client.setEx {τ : Type} [Transport.Transport τ] (client : Client τ) (key : String) (seconds : UInt64) (value : String) :

                                      Set a string value with a TTL in seconds.

                                      Example:

                                      let _ ← client.setEx "key" 30 "value"
                                      
                                      Equations
                                      Instances For
                                        def LeanRedis.Client.pSetEx {τ : Type} [Transport.Transport τ] (client : Client τ) (key : String) (milliseconds : UInt64) (value : String) :

                                        Set a string value with a TTL in milliseconds.

                                        Example:

                                        let _ ← client.pSetEx "key" 500 "value"
                                        
                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For