change doc.type to doc['type'] type is a var!
Merge branch 'dev' of https://github.com/fourbroad/agilenotes into dev