Method: Redis#select

Defined in:
lib/redis.rb

#select(db) ⇒ String

Change the selected database for the current connection.

Parameters:

  • db (Fixnum)

    zero-based index of the DB to use (0 to 15)

Returns:

  • (String)

    OK



72
73
74
75
76
77
# File 'lib/redis.rb', line 72

def select(db)
  synchronize do |client|
    client.db = db
    client.call([:select, db])
  end
end