Created
May 26, 2012 17:57
-
-
Save seanhess/2794782 to your computer and use it in GitHub Desktop.
Mongol
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{Model, Document} = | |
# make a db a-la mongodb-wrapper or mongolian | |
class Users extends Model | |
users = new Users db.collection 'users' | |
user = users.create {name: "Sean"} | |
user.save (err) -> | |
# Specify a schema | |
class Posts extends Model | |
schema: | |
title: String | |
body: String | |
posts = new Posts db.collection 'posts' | |
# etc | |
# Specify a document instance | |
class Comment extends Document | |
length: -> @body.length | |
class Comments extends Model | |
document: Comment | |
schema: | |
userId: String | |
body: String | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment