Skip to content

loicnestler/bearded-monk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bearded-monk

A ultra fast and lightweight ORM MongoDB driver built on top of monk and joi, heavily inspired by Mongoose

Usage

const beardedMonk = require('bearded-monk')('mongodb://localhost/test')
const {Joi, model} = beardedMonk

const userSchema = Joi.object().keys({
	name     : Joi.string().alphanum().min(3).max(32).required(),
	password : Joi.string().min(8),
	email    : Joi.string().email()
})

const User = model('User', userSchema)

const u = new User({
	name     : 'Foo',
	password : 'superSecretPassword',
	email    : 'foo@example.com'
})

u.save().then(() => {
	User.findOne({name: 'Foo'}).then((doc) => {
		console.log(doc)
	})
})

Docs

About

A ultra fast and lightweight ORM MongoDB driver built on top of monk and joi, heavily inspired by Mongoose

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published