示例#1
0
exports.setPrefix = function (t) {
  var oldPrefix = nohm.prefix;
  t.expect(1);
  nohm.setPrefix('hurgel');
  t.same(nohm.prefix, helper.getPrefix('hurgel'), 'Setting a custom prefix did not work as expected');
  nohm.prefix = oldPrefix;
  t.done();
};
示例#2
0
文件: nohm.js 项目: karlbohlmark/nohm
h = require(__dirname + '/helpers');

/**
 * The Nohm object used for some general configuration and model creation.
 * @namespace Nohm
 * @exports exports as Nohm
 */
function Nohm () {
}

/**
 * The redis prefixed key object.
 * Defaults to prefixing with 'nohm' which then creates keys like 'nohm:idsets:someModel'.
 * @static
 */
Nohm.prefix = h.getPrefix('nohm');

/**
 * The property types that get indexed in a sorted set.
 * This should not be changed since it can invalidate already existing data.
 * @static
 */
Nohm.indexNumberTypes = ['integer', 'float', 'timestamp'];

/**
 * The current global nohm redis client
 * @static
 */
Nohm.client = null;

/**
示例#3
0
文件: nohm.js 项目: karlbohlmark/nohm
Nohm.setPrefix = function (prefix) {
  Nohm.prefix = h.getPrefix(prefix);
};
示例#4
0
h = require(__dirname + '/helpers');

/**
 * The Nohm object used for some general configuration and model creation.
 * @namespace Nohm
 * @exports exports as Nohm
 */
function Nohm () {
}

/**
 * The redis prefixed key object.
 * Defaults to prefixing with 'nohm' which then creates keys like 'nohm:idsets:someModel'.
 * @static
 */
Nohm.prefix = h.getPrefix('nohm'); // TODO: create setPrefix

/**
 * The property types that get indexed in a sorted set.
 * This should not be changed since it can invalidate already existing data.
 * @static
 */
Nohm.indexNumberTypes = ['integer', 'float', 'timestamp'];

/**
 * The current global nohm redis client
 * @static
 */
Nohm.client = null;

/**