Skip to content

Instantly share code, notes, and snippets.

@pguillory
Created January 24, 2011 21:22
Show Gist options
  • Save pguillory/793986 to your computer and use it in GitHub Desktop.
Save pguillory/793986 to your computer and use it in GitHub Desktop.
function create_(record) {
var table = record._table
try {
var fields = prepareFields(record, table, { _version: 1 })
} catch (err) {
throw err
}
checkKeys_(table, record)
var id = redis.incr_(table + ':id')
saveFields_(fields, table, id)
redis.rpush_(table, id)
return self.retrieve_({ _table:table, _id:id })
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment