-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdb.js
41 lines (41 loc) · 915 Bytes
/
db.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
33
34
35
36
37
38
39
40
41
module.exports = {
name: "db",
ns: "mongojs",
description: "mongojs database",
phrases: {
active: "Creating mongodb connection: {{input.in}}"
},
ports: {
input: {
connection_string: {
type: "string",
title: "Connection String",
description: "The connection string should follow the format described in [the mongo connection](http://docs.mongodb.org/manual/reference/connection-string/) string docs",
require: true
}
},
output: {
db: {
type: "function"
}
}
},
dependencies: {
npm: {
mongojs: require('mongojs')
}
},
fn: function db(input, $, output, state, done, cb, on, mongojs) {
var r = function() {
output = {
db: $.create(mongojs($.connection_string))
}
}.call(this);
return {
output: output,
state: state,
on: on,
return: r
};
}
}