Skip to content

Instantly share code, notes, and snippets.

@peritus
Created December 10, 2011 16:45
Show Gist options
  • Save peritus/1455556 to your computer and use it in GitHub Desktop.
Save peritus/1455556 to your computer and use it in GitHub Desktop.
function(doc) {
// stolen from
// https://github.com/sstephenson/prototype/blob/master/src/prototype/lang/object.js#L88
function extend(destination, source) {
for (var property in source)
destination[property] = source[property];
return destination;
}
var copy = extend({}, doc);
delete copy._id;
emit(null, copy);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment