-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
32 lines (21 loc) · 820 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// loader for Mongo shell (dar be globals!)
// Thanks Justin (https://github.com/justinjmoses/mongo-views/blob/master/index.js)
// as loader has no return ability, we need a global to bind to
var __modules = {
table_view: { }
};
// Note: __CURDIR is set by the Makefile to ensure module loading works relative to this path
function require(relPath) {
'use strict';
var moduleName = relPath.replace(/^[\.\/]+/, '');
if (!(moduleName in __modules.table_view)) {
load(__CURDIR + '/lib/' + moduleName);
}
return __modules.table_view[moduleName];
}
(function (internals) {
'use strict';
load(__CURDIR + '/lib/init.js');
print('mongo-table-view is initiating!');
__modules.table_view['init.js'](internals);
})({ DBQuery: DBQuery, DBCommandCursor: DBCommandCursor });