Permalink
Browse files

key paths example

  • Loading branch information...
1 parent 2f711eb commit 36aae883efd9033225a592a9aa073187dba4143b @substack committed Jan 14, 2012
Showing with 19 additions and 0 deletions.
  1. +19 −0 example/key_paths.js
View
@@ -0,0 +1,19 @@
+var transfuse = require('../');
+var tr = transfuse(['rows', /./, 'c'], function (doc, map) {
+ doc.pizza = "tacos"
+ map(doc);
+});
+tr.pipe(process.stdout);
+
+var stream = new(require('net').Stream);
+stream.pipe(tr);
+
+stream.emit('data', JSON.stringify({
+ rows : [
+ { a : 3, c : {} },
+ { a : 4, c : { cats : 'dogs' } },
+ { a : 2, c : { beep : 'boop' } },
+ ],
+ bling : 'blong',
+}));
+stream.emit('end');

0 comments on commit 36aae88

Please sign in to comment.