mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-09-26 20:11:15 +08:00
48 lines
873 B
Plaintext
48 lines
873 B
Plaintext
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
# LPOP
|
|
|
|
### Syntax
|
|
```
|
|
LPOP key
|
|
```
|
|
|
|
### Module
|
|
<span className="acl-category">list</span>
|
|
|
|
### Categories
|
|
<span className="acl-category">list</span>
|
|
<span className="acl-category">write</span>
|
|
<span className="acl-category">fast</span>
|
|
|
|
### Description
|
|
Removes and returns the first element of a list.
|
|
|
|
### Examples
|
|
|
|
<Tabs
|
|
defaultValue="go"
|
|
values={[
|
|
{ label: 'Go (Embedded)', value: 'go', },
|
|
{ label: 'CLI', value: 'cli', },
|
|
]}
|
|
>
|
|
<TabItem value="go">
|
|
Removes and returns the first element of a list:
|
|
```go
|
|
db, err := sugardb.NewSugarDB()
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
element, err := db.LPop("key")
|
|
```
|
|
</TabItem>
|
|
<TabItem value="cli">
|
|
Removes and returns the first element of a list:
|
|
```
|
|
> LPOP key
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|