Skip to content
This repository was archived by the owner on Feb 22, 2019. It is now read-only.

Update serializers.js #97

Merged
merged 1 commit into from
Mar 26, 2013
Merged

Update serializers.js #97

merged 1 commit into from
Mar 26, 2013

Conversation

beatlevic
Copy link
Contributor

This fixes the issue you run into when trying to use a TimeUUID for a column name on a columnFamily.insert(). The column name cannot be a TimeUUID object, but needs to be a String. (Object keys cannot be objects themselves.)

Example:

keyspace.get('columFamily', function(err, cf) {
    var timeUUID = TimeUUID.fromTimestamp(new Date());
    var column = {};
    column[timeUUID] = JSON.stringify({oy: 'yo'});

    cf.insert('key', column, function(err) {
      if (err) throw(err);
    });
 })

This fixes the issue you run into when trying to use a TimeUUID for a column name on a columnFamily.insert(). The column name cannot be a TimeUUID object, but needs to be a String. (Object keys cannot be objects themselves.)
devdazed added a commit that referenced this pull request Mar 26, 2013
@devdazed devdazed merged commit eb5b21e into simplereach:master Mar 26, 2013
@devdazed
Copy link
Contributor

Ah, I see now. I'm not used to using the object syntax for inserting rows, hence why i could never reproduce this problem myself. The other workaround was to generate an array of columns eg:

var row = [],
    column = new helenus.Column(timeUUID, val);
row.push(column);
cf.insert('key', row, callback);

I'll go ahead and merge this in, good catch!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants