Skip to content

Instantly share code, notes, and snippets.

@ThisIsMissEm
Forked from devongovett/gist:480437
Created July 18, 2010 14:24
Show Gist options
  • Save ThisIsMissEm/480439 to your computer and use it in GitHub Desktop.
Save ThisIsMissEm/480439 to your computer and use it in GitHub Desktop.
var db = require("db-orm");
// Import the Email type from the context of the database.
var Email = db.types("Email");
// setup our database:
db.configure({
type: "redis",
host: "127.0.0.1",
port: 6379
});
exports.Employee = db.define('Employee', {
keys: {
"name": db.type( String, { required: true }),
"email": db.type( Email, { required: true })
},
relations: [
db.hasOne("office"),
db.hasMany("data", {model: "Datum"})
]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment