Skip to content

Instantly share code, notes, and snippets.

@seanhess
Created May 26, 2012 17:57
Show Gist options
  • Save seanhess/2794782 to your computer and use it in GitHub Desktop.
Save seanhess/2794782 to your computer and use it in GitHub Desktop.
Mongol
{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