Skip to content

Instantly share code, notes, and snippets.

@heapwolf
Created November 10, 2014 21:30
Show Gist options
  • Save heapwolf/6f945175779da78e6706 to your computer and use it in GitHub Desktop.
Save heapwolf/6f945175779da78e6706 to your computer and use it in GitHub Desktop.

JOIN

var store = require('store/client')(8001, '127.0.0.1');
var query = store.query;
var join = store.join;

var a = query('applications**'); // all keys in sublevel "applications" and any of its sublevels
var b = query('vendors*'); // all keys in "vendors"

join(a, b, function(chunk) {
  if (a.find('foo') == chunk.foo) return chunk;
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment