Created
May 1, 2014 13:23
-
-
Save secretfader/747c145ea9df4835e7cc to your computer and use it in GitHub Desktop.
Revisions
-
secretfader created this gist
May 1, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ var distill = require('distill'); var data = { id: 1, title: 'Hello, World', dirty_field: 'This field should not be exposed.', authors: { id: 2, name: 'Joshua', email: '[email protected]' } }; var output = distill(data) .field('id') .field('title') .embed('authors', 'id') .bottle(); // Output { id: 1, title: 'Hello, World', authors: [ { id: 2 } ] }