0.1.6 • Published 9 years ago

bemily-database v0.1.6

Weekly downloads
24
License
-
Repository
github
Last release
9 years ago

bemily-database

CouchDB views

'user/user'

This view display all user information.

function(doc) {
 if(doc.type == 'user') {
   emit(doc._id, {
	_rev: doc._rev,
	picture: doc.picture,
	name: doc.name, 
	surname: doc.surname,
	mail: doc.mail,
	major: doc.major,
	semester: doc.semester,
	subscribed_groups: doc.subscribed_groups,
	password: doc.password
	});
 }
}

'user/login'

View to display login information.

function(doc) {
 if(doc.type == 'user') {
   emit(doc._id, {
   	password: doc.password
   });
 }
}

Tests

Tests can be run with npm test or make test, make test-cov and test-cov-html. Note: npm test points to make test-cov. This is inspired from many hapi plugins.