Permalink
Browse files

Merge pull request #52 from calvinfo/master

Adding TTL option for inserts.
  • Loading branch information...
2 parents 8ca52da + 2f8dfc0 commit 5727a4c4f9f8e019bf138c4b084473434c474632 @devdazed devdazed committed Jun 3, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/column_family.js
View
7 lib/column_family.js
@@ -112,11 +112,12 @@ function normalizeParameters(list) {
/**
* Gets an array of columns from an object
* @param {Object} columns
+ * @param {Object} options
* @private
* @memberOf ColumnFamily
* @returns {Array} and array of columns
*/
-function getColumns(columns){
+function getColumns(columns, options){
var keys = Object.keys(columns), len = keys.length, i = 0, key, value, arr = [],
ts = new Date();
@@ -128,7 +129,7 @@ function getColumns(columns){
value = '';
}
- arr.push(new Column(key, value, ts));
+ arr.push(new Column(key, value, ts, options.ttl));
}
return arr;
}
@@ -205,7 +206,7 @@ ColumnFamily.prototype.insert = function(key, columns, options, callback){
}
if(!Array.isArray(columns)){
- columns = getColumns(columns);
+ columns = getColumns(columns, options);
}
var len = columns.length, i = 0, valueMarshaller, col,

0 comments on commit 5727a4c

Please sign in to comment.