Skip to content

Instantly share code, notes, and snippets.

View mclark-newvistas's full-sized avatar

Michael Clark mclark-newvistas

  • New Vistas
View GitHub Profile
var r = require('rethinkdb');
// you'd have to pass in an open rethink and deepstream connection, but that's trivial code to write
// rewrite of deepstream.io-provider-search-rethinkdb
module.exports = function(conn, client) {
var searches = new Map();
var pk = 'ds_id';
function getRow(path) {
// cribbed from official release
var EventEmitter = require('events');
var crypto = require('crypto');
var r = require('rethinkdb');
// source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
}