-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: added TYPE command documentation (#135)
Added TYPE command documentation. - @zenc0derr --------- Co-authored-by: Tejesh Kumar S <zenc0derr> Co-authored-by: Kelvin Mwinuka <[email protected]>
- Loading branch information
1 parent
4915f90
commit 5d3313d
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
# TYPE | ||
|
||
### Syntax | ||
``` | ||
TYPE key | ||
``` | ||
|
||
### Module | ||
<span className="acl-category">generic</span> | ||
|
||
### Categories | ||
<span className="acl-category">fast</span> | ||
<span className="acl-category">keyspace</span> | ||
<span className="acl-category">read</span> | ||
|
||
### Description | ||
Returns the string representation of the value type stored at the key. | ||
The types that can be returned are string, integer, float, list, set, set, and hash. | ||
|
||
### Examples | ||
|
||
<Tabs | ||
defaultValue="go" | ||
values={[ | ||
{ label: 'Go (Embedded)', value: 'go', }, | ||
{ label: 'CLI', value: 'cli', }, | ||
]} | ||
> | ||
<TabItem value="go"> | ||
Retrieve the type of the value stored at key: | ||
```go | ||
db, err := sugardb.NewSugarDB() | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
type, err := db.Type("key") | ||
``` | ||
</TabItem> | ||
<TabItem value="cli"> | ||
Retrieve the type of the value stored at key: | ||
``` | ||
> TYPE key | ||
``` | ||
</TabItem> | ||
</Tabs> |