This file contains 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 characters
/** | |
* A simple function that creates a new string from inputStr and removes bot h * leading and trailing sep strings. | |
* @param {String} inputStr The string to be trimmed. | |
* @param {String} sep The separator string to be trimmed. | |
* @private | |
*/ | |
function ctrim(inputStr, sep) { | |
var str = String(inputStr); | |
var regExpStr = '^'+sep+'+|'+sep+'+$'; | |
console.log('sep ',sep); |
This file contains 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 characters
var levelup = require('level') | |
var options = { | |
keyEncoding: 'binary' | |
} | |
//var key = 'name' | |
var key = 100 | |
// 1) Create our database, supply location and options. |
This file contains 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 characters
var MongoClient = require('mongodb').MongoClient; | |
var async = require('async'); | |
var collection; | |
var db; | |
var resultsLimit = 2; | |
async.series([ | |
// open connection to local MongoDB server | |
function(cb) { |
This file contains 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 characters
'use strict'; | |
var fivebeans = require('fivebeans'); | |
var client = new fivebeans.client('127.0.0.1', 11300); | |
var inspect = require('util').inspect; | |
var async = require('async'); | |
var jobid; | |
var data = { a: 'This is a', b: true, c: 55, d: { e: 'This is e.' } }; | |
var str = JSON.stringify(data); | |
client.on('connect', function() { |