Skip to main content

MOVE

Syntax

MOVE key database

Module

generic

Categories

fast keyspace write

Description

Move key from currently selected database to specified destination database. Returns 1 if successful, if key already exists in the destination database, or key does not exist in the source database, it does nothing and returns 0.

Examples

Move the key to database 1:

db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
value, err := db.Move("key", 1)