Skip to content

Commit

Permalink
swap mongodb for mongoose
Browse files Browse the repository at this point in the history
  • Loading branch information
samccone committed Mar 27, 2013
1 parent 38b9ece commit 7424d3e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
21 changes: 17 additions & 4 deletions db/interface.js
@@ -1,11 +1,24 @@
var Db = require('mongodb')
var mongoose = require('mongoose');

exports.connect = function(cb) {
Db.connect(process.env['db'] || 'mongodb://localhost/db', function(err, d) {
mongoose.connect(process.env['db'] || 'mongodb://localhost/db', function(err, d) {
if (err) {
console.log("º Error Connecting", JSON.stringify(err));
} else {
console.log("º DB Connected");
setSchemas()
}
})
}
});
}

function setSchemas() {
var frameSchema = mongoose.Schema({
title: String,
url: String,
caption: String
});

var frame = mongoose.model('frame', frameSchema);
}

exports.inser
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -12,7 +12,7 @@
"express-validator": "~0.3.2",
"jade": "~0.28.2",
"imagemagick": "~0.1.3",
"mongodb": "~1.2.14"
"mongoose": "~3.6.0"
},
"repository": "",
"author": "Sam Saccone",
Expand Down

0 comments on commit 7424d3e

Please sign in to comment.