Documentation

LeanRedis.Client.List

Push values to the left side of a list.

Example:

let len ← client.lPush "jobs" #["a", "b"]
Equations
Instances For

    Push values to the right side of a list.

    Example:

    let len ← client.rPush "jobs" #["a", "b"]
    
    Equations
    Instances For

      Push a value to the left only if the list already exists.

      Example:

      let len ← client.lPushX "jobs" "a"
      
      Equations
      Instances For

        Push a value to the right only if the list already exists.

        Example:

        let len ← client.rPushX "jobs" "a"
        
        Equations
        Instances For

          Pop one value from the left side of a list.

          Example:

          let value ← client.lPop "jobs"
          
          Equations
          Instances For

            Pop one value from the right side of a list.

            Example:

            let value ← client.rPop "jobs"
            
            Equations
            Instances For

              Return the current length of a list.

              Example:

              let len ← client.lLen "jobs"
              
              Equations
              Instances For

                Return the value at a list index.

                Example:

                let value ← client.lIndex "jobs" 0
                
                Equations
                Instances For

                  Return a range of list elements.

                  Example:

                  let values ← client.lRange "jobs" 0 (-1)
                  
                  Equations
                  Instances For
                    def LeanRedis.Client.lSet {τ : Type} [Transport.Transport τ] (client : Client τ) (key : String) (index : Int) (value : String) :

                    Replace the value at a list index.

                    Example:

                    let _ ← client.lSet "jobs" 0 "next"
                    
                    Equations
                    Instances For
                      def LeanRedis.Client.lTrim {τ : Type} [Transport.Transport τ] (client : Client τ) (key : String) (start stop : Int) :

                      Trim a list to the given inclusive range.

                      Example:

                      let _ ← client.lTrim "jobs" 0 9
                      
                      Equations
                      Instances For
                        def LeanRedis.Client.lRem {τ : Type} [Transport.Transport τ] (client : Client τ) (key : String) (count : Int) (value : String) :

                        Remove matching elements from a list.

                        Example:

                        let removed ← client.lRem "jobs" 0 "done"
                        
                        Equations
                        Instances For
                          def LeanRedis.Client.lInsert {τ : Type} [Transport.Transport τ] (client : Client τ) (key : String) (position : LInsertPosition) (pivot value : String) :

                          Insert a value before or after a pivot element.

                          Example:

                          let index ← client.lInsert "jobs" .after "a" "b"
                          
                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            def LeanRedis.Client.lMove {τ : Type} [Transport.Transport τ] (client : Client τ) (source destination : String) (fromWhere toWhere : LMoveWhere) :

                            Move one element between lists.

                            Example:

                            let value ← client.lMove "jobs" "done" .left .right
                            
                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              def LeanRedis.Client.lPos {τ : Type} [Transport.Transport τ] (client : Client τ) (key element : String) (options : LPosOptions := { }) :

                              Return a single matching position from LPOS.

                              Example:

                              let pos ← client.lPos "jobs" "a"
                              
                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For

                                Return multiple matching positions from LPOS.

                                Example:

                                let positions ← client.lPosMany "jobs" "a" { count? := some 3 }
                                
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For