Permalink
Browse files

new client version, other stuff

  • Loading branch information...
1 parent d51c2fe commit 2e55c464144b71dd0e3773a9e8e383cc54fe88d1 @mohlendo committed Nov 13, 2009
Showing with 20 additions and 6 deletions.
  1. +19 −5 redis.js
  2. +1 −1 server.js
View
@@ -136,7 +136,17 @@ Redis.prototype.getset = function(key, value) {
return this._send("GETSET " + key + " " + value.length + CRLF + value);
};
-// mget, setnx
+Redis.prototype.mget = function(/*keys*/) {
+ var keys = [];
+ for (var i = 0; i < arguments.length; i++) {
+ keys.push(arguments[i]);
+ }
+ return this._send("MGET " + keys.join(" "));
+};
+
+Redis.prototype.setnx = function(key, value) {
+ return this._send("SETNX " + key + " " + value.length + CRLF + value);
+};
Redis.prototype.incr = function(key, by) {
if (by) {
@@ -152,16 +162,20 @@ Redis.prototype.decr = function(key, by) {
return this._send("DECR " + key);
};
-// exists, del, type
+Redis.prototype.del = function(key) {
+ return this._send("DEL " + key);
+};
+
+Redis.prototype.type = function(key) {
+ return this._send("TYPE " + key);
+};
// commands operating on the key space
-Redis.prototype.dbSize = function() {
+Redis.prototype.dbsize = function() {
return this._send("DBSIZE");
};
-// ....
-
// commands operating on lists
Redis.prototype.rpush = function(key, value) {
View
@@ -106,7 +106,7 @@ function createSession (nick) {
},
switchTo: function (channelName) {
- if (session.channel.name != channelName) {
+ if (session.channel.name !== channelName) {
session.channel.appendMessage(session.nick, "part");
session.channel = channels[channelName] || createChannel(channelName);
session.channel.appendMessage(session.nick, "join");

0 comments on commit 2e55c46

Please sign in to comment.