{"_id":"mongolia","_rev":"85-82dfa9018c7949c479bcb3950216902b","name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","dist-tags":{"latest":"1.5.1"},"versions":{"0.0.1":{"name":"mongolia","description":"Mongodb driver wrapper. Acts as model.","version":"0.0.1","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"keywords":["mongo","mongodb","orm","database","db"],"main":"./lib/model","dependencies":{"mongodb":">= 0.8.0"},"engines":{"node":">= 0.2.0"},"_id":"mongolia@0.0.1","_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"https://registry.npmjs.org/mongolia/-/mongolia-0.0.1.tgz","shasum":"4230528302bbe9cf039f8235def1bb388cdbaecd","integrity":"sha512-dVO1+TUCvpzh+QwdAc3fVhbPk1lFBBZIeG1PuZgFdhqqttIss37wfwCP4TXzhfuAStQOeMSoQ7JAo73Y3m3ZVg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHhxd89/0qJbqwc3XhGI9hLsvACuqrR9mEhYiWiQgUwAIgA2orzvu9l/U1abTpEc2yYB7yM3jD/SyUnJLgNYnc3Bk="}]}},"0.0.2":{"name":"mongolia","description":"Mongodb driver wrapper. Acts as model.","version":"0.0.2","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"keywords":["mongo","mongodb","orm","database","db"],"main":"./lib/model","dependencies":{"mongodb":">=0.7.9","funk":"0.0.1","class":"0.3.0"},"repository":{"type":"git","url":"http://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.2.0"},"_id":"mongolia@0.0.2","_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"https://registry.npmjs.org/mongolia/-/mongolia-0.0.2.tgz","shasum":"8a24ea1f7bb3f06032b6afb46175df2f1e95dec5","integrity":"sha512-jjJb4tO/EefPaaAhIVM2bfFmZ7vgppyfkz5hEzBkg2KfOhevELePsVARa/42Rpsy5YqkkYPWh4HvWIldWc0RLQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBWVHKHztxvEVtFjcg2oElb4jzk4aIWpwL7jdM4ljhpXAiAbllbVKbW7S0fAXmgZY9uSTOkMm0MM3E/UJhTXEuRc6A=="}]}},"0.0.3":{"name":"mongolia","description":"Mongodb driver wrapper. Acts as model.","version":"0.0.3","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"keywords":["mongo","mongodb","orm","database","db"],"main":"./lib/model","dependencies":{"mongodb":">=0.7.9","funk":">=0.0.1"},"repository":{"type":"git","url":"http://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.2.0"},"_id":"mongolia@0.0.3","_nodeSupported":true,"_npmVersion":"0.2.7-3","_nodeVersion":"v0.2.3","dist":{"tarball":"https://registry.npmjs.org/mongolia/-/mongolia-0.0.3.tgz","shasum":"baf6c9fc1086f57304eed1671b0984ea6001f831","integrity":"sha512-KoJMiguDSycFma3pDOvUt65F7GyITR1H6ZPBrXUNaH7O8/fnq/9p7Mr6g3abhIOnwWtP1HRt7BeE1MVA46R3Hg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2AXcj+YX1iUKU5VOkNOiHodClQZjHCC4QYyHiROYfnQIgLf9UktB6mvgLggJF9Tr+R2UtZ2bkDj3ARCY/T9Beh3c="}]}},"0.0.4":{"name":"mongolia","description":"Mongodb driver wrapper. Acts as model.","version":"0.0.4","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"keywords":["mongo","mongodb","orm","database","db"],"main":".index","dependencies":{"mongodb":">=0.7.9","funk":">=0.0.1"},"repository":{"type":"git","url":"http://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.2.0"},"_id":"mongolia@0.0.4","_nodeSupported":true,"_npmVersion":"0.2.7-3","_nodeVersion":"v0.2.3","dist":{"tarball":"https://registry.npmjs.org/mongolia/-/mongolia-0.0.4.tgz","shasum":"f34d6fc49df4f915f0bd2fd7ec87c12cee86f07d","integrity":"sha512-hDSxtYI5O9ADVGPauXx/ANBR6LW9GVGfpYGi3G7auYQzVEB9vcjIaPkKuSJVfGEJi2juAUlo65u4+VJZgyfd/Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHYdVeMIvNgAIvSaDyPZZiQDUg6wGJET/RrjKnHk3RXCAiEA6kE4XUcuAyjtc7/P9nYn/KlHufAvSKAq97CQEKPDqv4="}]}},"0.0.5":{"name":"mongolia","description":"Mongodb driver wrapper. Acts as model.","version":"0.0.5","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"keywords":["mongo","mongodb","orm","database","db"],"main":"./index","dependencies":{"mongodb":">=0.7.9","funk":">=0.0.1"},"repository":{"type":"git","url":"http://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.2.0"},"_id":"mongolia@0.0.5","_nodeSupported":true,"_npmVersion":"0.2.7-3","_nodeVersion":"v0.2.3","dist":{"tarball":"https://registry.npmjs.org/mongolia/-/mongolia-0.0.5.tgz","shasum":"e7d770f4e0445fbda10a6714b57aafb675538078","integrity":"sha512-N/UUZKUSwPGqYZIbC4iq8JrgsTGDE2KSi68xGXot8TAG8hzaWpLb5N1t77YIfaNmvsLS9P19Wlw32WCFWj1PiA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICCEYQWxqc79cDlNWo5xlAxbmhT6N9KD3mOrL21+HetdAiEA9Oz2nlDtTZgqQATg7OBK73dt5IYZmdUY9wr8JOsaLBU="}]}},"0.0.6":{"name":"mongolia","description":"Mongodb driver wrapper. Acts as model.","version":"0.0.6","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"keywords":["mongo","mongodb","orm","database","db"],"main":"./index","dependencies":{"mongodb":">=0.7.9","funk":">=0.0.1"},"repository":{"type":"git","url":"http://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.2.0"},"_id":"mongolia@0.0.6","_nodeSupported":true,"_npmVersion":"0.2.7-3","_nodeVersion":"v0.2.3","dist":{"tarball":"https://registry.npmjs.org/mongolia/-/mongolia-0.0.6.tgz","shasum":"be3557d7a9fd12f9ade315d42ca8e860069e55bc","integrity":"sha512-5rxIxlgpB3/xGtQaJUVWVIcvFd1H6ExMHq0UG2+vEKUc4YBbGHfBdNn7VgE3Fy/xhqORNrx5z+JqZgciKE6AhQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvOqC7URDknXV+3LulSxWVGAQF5p2WjuBgwVaDEYd+vQIgQcWCXocmbZL5zpvc/KAZ2MmJLb9DjQO6dvG8kJ1qalE="}]}},"0.0.7":{"name":"mongolia","description":"Mongodb driver wrapper. Acts as model.","version":"0.0.7","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"keywords":["mongo","mongodb","orm","database","db"],"main":"./index","dependencies":{"mongodb":">=0.7.9","funk":">=0.0.2"},"repository":{"type":"git","url":"http://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.2.0"},"_id":"mongolia@0.0.7","_nodeSupported":true,"_npmVersion":"0.2.7-3","_nodeVersion":"v0.2.3","dist":{"tarball":"https://registry.npmjs.org/mongolia/-/mongolia-0.0.7.tgz","shasum":"a90250c55403e212ad0850d1a7860d407fd00a19","integrity":"sha512-zP+QUg74391VLf2u1jjgFGDUZTHey3ecyoH7LssONiM2UU7QEskIQ0zAEum1Bpa4jooK03q193k81YRXiR66yg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUttlOsCXhzxqPUxH8NIG/jQj3xn4een2YW2KNN2KHsgIhAPEFZGZS/gqh2fFXLi3Eya1YiFm9bGmjJhN2Iebe18zJ"}]}},"0.0.8":{"name":"mongolia","description":"Mongodb driver wrapper. Acts as model.","version":"0.0.8","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"keywords":["mongo","mongodb","orm","database","db"],"main":"./index","dependencies":{"mongodb":">=0.7.9","funk":">=0.0.2"},"repository":{"type":"git","url":"http://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.2.0"},"_id":"mongolia@0.0.8","_engineSupported":true,"_npmVersion":"0.2.13-2","_nodeVersion":"v0.2.3","dist":{"shasum":"19663f9cac704caefe5e6ecbe5473d008bbdf3b0","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-0.0.8.tgz","integrity":"sha512-DsynjG3yaywm7M25r2SjehsM1X7r0dj/xAdcjfWWzxutNWzkfzC1E778CfprCvcl50FVzoNx+aPDW/m/EiODQg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICrdmyp3jBCckPnNeOmTqyCA0RdyznA8zmasvogQiJbVAiAC1Uiho74DRKe3x4KGee03DCiembNeIUN5xC0UFKt+2w=="}]}},"0.0.9":{"name":"mongolia","description":"Mongodb driver wrapper. Acts as model.","version":"0.0.9","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"keywords":["mongo","mongodb","orm","database","db"],"main":"./index","dependencies":{"mongodb":">=0.7.9","funk":">=0.0.2"},"repository":{"type":"git","url":"http://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.2.0"},"_id":"mongolia@0.0.9","_engineSupported":true,"_npmVersion":"0.2.13-3","_nodeVersion":"v0.2.3","dist":{"shasum":"418262dd0ebc4efde9c2ceb4942a0952ae40e375","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-0.0.9.tgz","integrity":"sha512-TjE+1yEUXX2TOSPm5XR/XNpmKnouaSLUXlzqD2AQuk0x6L+cds3Gr7Y46i20fEPAEAPEDwqsc9IhY0FeKBQMVA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC8NI65Kx9rR2rJ6QlCd7HsPG1MZPUN2caA08Qn4QsxMAiB7RUZOs2gWwARyCJEl8fn9HLy0l87PJxn7tHamhiYoyw=="}]}},"0.0.10":{"name":"mongolia","description":"Mongodb driver wrapper. Acts as model.","version":"0.0.10","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"keywords":["mongo","mongodb","orm","database","db"],"main":"./index","dependencies":{"mongodb":">=0.7.9","funk":">=0.0.2"},"repository":{"type":"git","url":"http://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.2.0"},"_id":"mongolia@0.0.10","_engineSupported":true,"_npmVersion":"0.2.14-3","_nodeVersion":"v0.2.6","directories":{"lib":"./lib"},"modules":{"model.js":"lib/model.js","utils.js":"lib/utils.js","validator.js":"lib/validator.js"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"43be8c69075ee7b4178718a16130a72b1fe7c52a","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-0.0.10.tgz","integrity":"sha512-moKlSi0dLGCGbEHsMFXwFJEkRya36Ff0Ch59FE69YXEEJAe1aAhKOYbaT667u7KZYnguzSBtJmUVGdY7pm7Y6g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBP2QFqXhPz8g2aICRCCetMX6iFmoApMhOOxpn67I3pIAiAHVF65i0el6urHiJg/smQGSxZ6tWLGRHGF6gqRO8x8cA=="}]}},"1.0.0":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.0.0","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":">=1.0.1"},"devDependencies":{"testosterone":">= 1.2.0","gently":">= 0.9.0"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_id":"mongolia@1.0.0","_engineSupported":true,"_npmVersion":"1.0.1rc9","_nodeVersion":"v0.4.2","_defaultsLoaded":true,"dist":{"shasum":"36a0c7271738d5649ddd15b842c2fb21a81bce37","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.0.0.tgz","integrity":"sha512-0iVsP3Hbzo4j3iIaRmpnGaCatswX4xWRaMZBm5tTbnF7AsdrokqT6tGGzdZYRYQrShjW6GFfmk0dZuk0VNNeyg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGxlCNOhFjhxYJAg1lN5YUM8I+Rt8TR83Gtz55jsD0KZAiEA8k2oahknVjxMbFfC8L8xoYA5z71ORR+MbWyaX2un/jk="}]}},"1.0.1":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.0.1","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":"1.0.1"},"devDependencies":{"testosterone":"1.2.0","gently":"0.9.1"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_id":"mongolia@1.0.1","_engineSupported":true,"_npmVersion":"1.0.6","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"939d3a7246cabc22f16421f6de737977dba2b65f","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.0.1.tgz","integrity":"sha512-sJilh78EAo3lNhyPxLohJBFPMHpz6H9Xn97HFoFAuGEb5QmtuWkexL0zrUyGtQdCcDvKDbla0m4xjUmu1idv9Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF+Cz91yAQc/8vy3meeC5W7KORABqw8QDZ7BFhzQN6JsAiBn/bAVr9PcdIa2hWAgMZslW0YYlFWqlhtnpEzRbeVCRQ=="}]},"scripts":{}},"1.1.0":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.1.0","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"testosterone":"1.2.0","gently":"0.9.1"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_id":"mongolia@1.1.0","_engineSupported":true,"_npmVersion":"1.0.6","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"9f37989b85ee7fb99afba41c60dbf4e8fd34c39f","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.1.0.tgz","integrity":"sha512-GvmjfJHLcGE//78MMh05w/TnSK+//iA9N1l8/avSy3m6keXCrLmOzuh4084v014yuqc6wsR9GJ4w8xsIwvjAlQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDd2lTI8Dr1xMQhruhj3iLcHWbv/4OCdL+ACTI7hnn6iwIhALYtBstJSvka6ioqW5TuAg9ogemcdd+zOo+5yemJZ48f"}]},"scripts":{}},"1.2.0":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.2.0","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"testosterone":"1.2.0","gently":"0.9.1"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_id":"mongolia@1.2.0","_engineSupported":true,"_npmVersion":"1.0.7","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"4d4e9348fd1246ab13ece86aa963b4bc7f2f4cbc","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.2.0.tgz","integrity":"sha512-rJVaTRGNgIjTqY3uq3/PyK7flAPu8uhcBWxUGkNfddod3ei5/Jj4Ejp5ppZxUkAUNzSy5arfn3f8eRyH4cpLaA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB/8hcZYHgL2Bo9+kEilKjAkbnfdwASk67zsCvbgSQiPAiBhvoCpOg4YlVYk3ZUfwGW3UIK6f1SYSN93v1KhOo+1eA=="}]},"scripts":{}},"1.2.2":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.2.2","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"testosterone":"1.2.0","gently":"0.9.1"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_id":"mongolia@1.2.2","_engineSupported":true,"_npmVersion":"1.0.7","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"cf4f47e80376b7c5b762ae0a48bc2c03872bfba5","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.2.2.tgz","integrity":"sha512-tckDhkRjDMwpWSIZ1kAFhWnbUHqO2LCH58JRONC2bt4kqRIVfL/5ofgi9XLPHGan1QkxLOViAMTm9DA5z0kkYA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDim1mokEoc5xiPpPOuH5HM1MvdfZRT8c0u3sSpzmk+RAiEA/80tSpRHE2HNejwQbAfj/7OzKlnZ9F4ul0Sw2Cq4SCg="}]},"scripts":{}},"1.2.3":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.2.3","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"testosterone":"1.2.0","gently":"0.9.1"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_id":"mongolia@1.2.3","_engineSupported":true,"_npmVersion":"1.0.7","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"8f3baeb82b927178dc30f9b94a215d05bad8a65a","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.2.3.tgz","integrity":"sha512-hMKJWwC2nLHZ+DUk0K58nXS36/WvpsdaX9QOxYTxlDWbc8SYgBY7mI+8x2H1bBlnHNZWmg3DwuS0SRVfrhoQbw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICwk8Q/0mOkW4qMKPZrwtg8wao0pmntmH6IT/MO3bxwPAiBAMZ2mH/HkfMIK08d9XaDGET+PdRV4JKb8ZZQ9CXaSzw=="}]},"scripts":{}},"1.2.4":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.2.4","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"testosterone":"1.2.0","gently":"0.9.1"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_id":"mongolia@1.2.4","_engineSupported":true,"_npmVersion":"1.0.7","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"782c369715e1da23c4345ba69754b11739a2ea57","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.2.4.tgz","integrity":"sha512-1SdovPvHEr35WW4SQgjsQwZDITwyYyHUNaFw4Y/XyOvtL1fiEK4G3OVTGYJtnJta1AdN6rzkDFhvx1CJ+r/11Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGCvWSouizxCciTsxxTBuy489hiXse0tNd5KRxFshvChAiEA1iiTA+jJSDfP3ZXXYauSOe6lLA+i7U+VifrgJb69qv0="}]},"scripts":{}},"1.2.5":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.2.5","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"testosterone":"1.2.0","gently":"0.9.1"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_id":"mongolia@1.2.5","_engineSupported":true,"_npmVersion":"1.0.7","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"46866018db4381eea291de6a2a98eb22a3afd4cb","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.2.5.tgz","integrity":"sha512-hJDiHmGfXB5G2rcqbmsGTp3m165QFYDk0FftrZTFT/NFgLgkL4bgbG2beJGDpbvHLMi+9MGllHS2nGR2USiOqA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+RQj+dmXZwg7uMOJf32qR9ztYRx1OEzrjs3158PrgKAIhAKuPB1EqpWQyiXjOFT3+NaPf2eMA0rbQMUJKtSh+PSW2"}]},"scripts":{}},"1.2.6":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.2.6","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"testosterone":"1.2.0","gently":"0.9.1"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_id":"mongolia@1.2.6","_engineSupported":true,"_npmVersion":"1.0.7","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"7fd8134d765830847630a47f785474ab008a6167","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.2.6.tgz","integrity":"sha512-DZIuMi+FN3/xI0xMShFYEcg060gknI8FWO8eZvIuK54AGbzE6q+LVhmyPR/PG3WMZr/nNc0J3rPDPmiVhbDrSQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGvsRKhFEW8AI9/5ye2dWjJwZrnJE08ZwMy3NcVCGMzmAiEA8ndduVIoD406U2or0Ylqm7yzYiaQaJIChV+hvjWPUDA="}]},"scripts":{}},"1.2.7":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.2.7","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"testosterone":"1.2.0","gently":"0.9.1"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_id":"mongolia@1.2.7","_engineSupported":true,"_npmVersion":"1.0.7","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"7e85a57179ffc009a4314c9df958ac3aa65dc64b","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.2.7.tgz","integrity":"sha512-ld2O0DqRCSz84U11VBeHjx8zKvObfIITbttMdDASRR+1bqHRQq1dmKr/EbdFiEmO0mihMMOO/miZTRA8WjlxqQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDzxXDzwM3QKgNO7pEchP7Di0brAyZ2FhBumG31Y5AM1AiBSdxTnX1R5JpProOwyxaCvZxGm5P+FHxywXCJQy+OIoQ=="}]},"scripts":{}},"1.2.8":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.2.8","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"testosterone":"1.2.0","gently":"0.9.1"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_id":"mongolia@1.2.8","_engineSupported":true,"_npmVersion":"1.0.7","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"6b690789d7bc2b3892e9c0d40b2138bc49f3828f","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.2.8.tgz","integrity":"sha512-RQDlcdYJmV33kf8ICr0x/Z1N+Wn5rq+m96NwQadT6tt1ohm0aPzV9xJH3cHVrk+Me7ssMRKggzvDIy9XJwz31A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBjcaglRGCjPGdzeJ6RZmsacJfG4QibSus5zTu5yux+nAiBgp4zpK738AfoxsTl/iH0nwKIlNvqCoPbvZRD5F4w3Jw=="}]},"scripts":{}},"1.2.9":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.2.9","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"testosterone":"1.2.0","gently":"0.9.1"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_id":"mongolia@1.2.9","_engineSupported":true,"_npmVersion":"1.0.7","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"1be9b476dc13db0b431aebd35ee634118d546d66","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.2.9.tgz","integrity":"sha512-xtidC8ZOXajJ9POWh5fPUzF1HFL8d4eFpVfFWEuaSJwIQ1khni0bohYKO+104FfNOJ/CSb8B0nkIE3Uvfq+99g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJeZlR75wbajjeLJsySH5uFmjavmMJVgfhs1ogGHujxQIhAOnV+KSU9rHSZB5IzxIuigh5vSFq2iT+bKBFulErRV5c"}]},"scripts":{}},"1.3.0":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.3.0","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"testosterone":"1.2.0","gently":"0.9.1"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_id":"mongolia@1.3.0","_engineSupported":true,"_npmVersion":"1.0.7","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"36514ec87ba86cb502765318fd320fa1177e3a06","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.3.0.tgz","integrity":"sha512-JJdTXUpl6g0TmlKA5/ts17mMweE/p6OYi8PwFHX4/X94mMer+VL8LI1TVnG6h230sdzIRR/iJvKQ/rsleH7Adg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2i1lqpcjH5uxsuOZAPRXi5i18lCIGoPkQZawnHIdpUAIgJZZ4Uw2CBMqI10Gx2ADwqm3Yw2hDSnxEFJR60InRJR4="}]},"scripts":{}},"1.3.1":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.3.1","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"testosterone":"1.2.0","gently":"0.9.1"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_id":"mongolia@1.3.1","_engineSupported":true,"_npmVersion":"1.0.7","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"854ab070d32ec93170c3e09f68b40f340c29bbbe","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.3.1.tgz","integrity":"sha512-hOPzZrfq9H5jUJx1ClnSLhRF7Pdm4PV8R5u4T4Mq14cktrmly8dS0Q3BriPMMKDf4n5OI+ufZwuxZVLtHoUezw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDUwzWPGwm341RAxCmKs231CU4ru3sUUZBCTd+CL+lJOAiEA4eNaW10gBwh+uYd3Y5TsNzN+EiSsv+mNGENK7VM53Os="}]},"scripts":{}},"1.3.2":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.3.2","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"testosterone":"1.2.0","gently":"0.9.1"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_id":"mongolia@1.3.2","_engineSupported":true,"_npmVersion":"1.0.7","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"fd2c860d476d2eaa088decedd3045c89aab201ce","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.3.2.tgz","integrity":"sha512-XhBWahAFsvQzCfFIOue5c8NP+oAGjZwBArYZD5xPOrcndSDhaNqWw5LSF0RZ1/uycCJ8FvQMMnVxyKNJjc2Bbg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDkUEbr9/LlFOVj78MGj64GopsHpqsTYsUvh7yCw+3T3AiEAq1LXfOMz1eF5GfrZjGFa6uGCxTyNTlcvt6I4aeO/Xd4="}]},"scripts":{}},"1.3.3":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.3.3","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"testosterone":"1.2.0","gently":"0.9.1"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_id":"mongolia@1.3.3","_engineSupported":true,"_npmVersion":"1.0.7","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"dadec7e169a00b7011b81c1225694910b035bd9b","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.3.3.tgz","integrity":"sha512-GUQk9OVVfdX/9MLso0RuE/RXREzfoENz7CxPI4Oz+3jMMrRGmQ9HSGtekJmelchI/mSy321F+FvNnFGNeXeVCA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFCIu7LO/fiy65B2GX5Xg/AgtFCrIzDCmUvzkDcv9VxXAiEA3JaraIQURSw5Cds9GaFok8OnEIAVzb4fYOR124G8/8c="}]},"scripts":{}},"1.3.4":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.3.4","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"testosterone":"1.2.0","gently":"0.9.1"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_npmJsonOpts":{"file":"/Users/masylum/.npm/mongolia/1.3.4/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"mongolia@1.3.4","_engineSupported":true,"_npmVersion":"1.0.13","_nodeVersion":"v0.4.9-pre","_defaultsLoaded":true,"dist":{"shasum":"179b0478d9f65f247924aa9e2b29121248b3a0b6","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.3.4.tgz","integrity":"sha512-LlzY50V/F3EnjCBAh7yBqMeU1AfwbyMmcn1NADfeL9E2OQ/cL/bzngWoJ8aY+mqriKtsmX0zTT3qTk6HhLwPEw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNQRtvWd/n+B0qtN+jFrR5z2q2QfPP97Hye7Kca4Ao8QIhAKH3LBd2nwHdHgkhS9tCXnzPYK8FLZqU1nk8fpAOLBIm"}]},"scripts":{}},"1.3.5":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.3.5","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"testosterone":"1.2.0","gently":"0.9.1"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_npmJsonOpts":{"file":"/Users/masylum/.npm/mongolia/1.3.5/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"mongolia@1.3.5","_engineSupported":true,"_npmVersion":"1.0.13","_nodeVersion":"v0.4.9-pre","_defaultsLoaded":true,"dist":{"shasum":"9e88367a85331ccbc54276b8838efb43253beab7","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.3.5.tgz","integrity":"sha512-lcNDDaIrm0XdPleQO/dx0P7xGAG2SsOtl5x0cXNzuQUFy2C31WfG/2N+bVMGvMH3OiY/udhealBr7DKWWxm2sA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEbLU1b9P7M0xjwUC3dCxO+zUb0qMsPpJImD0bjO8IvyAiEA0B5z02xpClJ7EThKVBSLAPeHPs7PxbcNGwYAK2FJ6nE="}]},"scripts":{}},"1.4.0":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.4.0","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"testosterone":"1.2.0","gently":"0.9.1"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_npmJsonOpts":{"file":"/Users/masylum/.npm/mongolia/1.4.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"mongolia@1.4.0","_engineSupported":true,"_npmVersion":"1.0.13","_nodeVersion":"v0.4.9-pre","_defaultsLoaded":true,"dist":{"shasum":"da9736edd1a0851f6b8ab5f5e68ec703eaa8a6b3","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.4.0.tgz","integrity":"sha512-zMLMIg5PNjJ+1rSRjIs++ItCT/dEWfNBastjx8gKtYHHiiNv5AXq05BxCqg10hUQkjngp2Yh2OtDjmoBieOSMg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIENOhvOvUMYj/Z1Vy8FFkNISfnP+GiAXTLdWNyZvP0ntAiEAsbzw4/jPaRcXH4szfqONaF53ut92wVxaEilK66a1COc="}]},"scripts":{}},"1.4.1":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.4.1","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"testosterone":"1.2.0","gently":"0.9.1"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_npmJsonOpts":{"file":"/Users/masylum/.npm/mongolia/1.4.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"mongolia@1.4.1","_engineSupported":true,"_npmVersion":"1.0.13","_nodeVersion":"v0.4.9-pre","_defaultsLoaded":true,"dist":{"shasum":"ee3ffa19da7bc7387e4d21f5ecc49502e0783c3b","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.4.1.tgz","integrity":"sha512-Dz9IOtOaBYywT4PgseCEtdwqFXyw5C91CYfy74SIz8B42fdqn5uo4zZqZC7ceneHJMNOXHTJgOPGPZjnLE84CQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtEoqCRneDKo/FhuUiQVxSuCh5Et5bmYqVxCOVK2AJZQIhANa8XOcMu4BD/QWM0EPiUn9NEMFiL5aDBhdF0aeg2E7C"}]},"scripts":{}},"1.4.2":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.4.2","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"testosterone":"1.2.0","gently":"0.9.1"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_npmJsonOpts":{"file":"/Users/masylum/.npm/mongolia/1.4.2/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"mongolia@1.4.2","_engineSupported":true,"_npmVersion":"1.0.13","_nodeVersion":"v0.4.9-pre","_defaultsLoaded":true,"dist":{"shasum":"28c3b80965a0da80a50899ce37703718646c8aad","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.4.2.tgz","integrity":"sha512-4XcrF3o7XMxHoEg7pDmAodBkm7/bwVizzy7D0kGyDsAIuTig4IKdgOZySdWI5vUj5nsAru6eEBVmLNiAUIRlgg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGeCQjl53f6xuK/LcTTMTpdiBba4jkQSBd1GnDfzcWLZAiEAyzJGI4JpVY6lyUQjU+sBLT2U3ImqttUnJ11xqhhjuWs="}]},"scripts":{},"maintainers":[{"name":"masylum","email":"masylum@gmail.com"}]},"1.4.3":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.4.3","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":">=0.9.3","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"testosterone":"1.2.0","gently":"0.9.1"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_npmJsonOpts":{"file":"/Users/masylum/.npm/mongolia/1.4.3/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"mongolia@1.4.3","_engineSupported":true,"_npmVersion":"1.0.13","_nodeVersion":"v0.4.9-pre","_defaultsLoaded":true,"dist":{"shasum":"50cf61754b0dd691e15c8bb5fa73eb4275754c80","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.4.3.tgz","integrity":"sha512-F9ysmnvO8ghLlWb7hJVPGwfYi6396//DxmGRUdbg2l9dQUKK1PpbxuytQO/QCSjOPoj/Cq/p6XD+Fi2YY308Rw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0OzG5OM9ItMtwkuho6OmwVK0p2d97PhOJB6jC8anguwIhAJKj/LkcrrVH+rOZGbuzJszMrpbJhLsjVY7mYqQIp0aZ"}]},"scripts":{},"maintainers":[{"name":"masylum","email":"masylum@gmail.com"}]},"1.4.4":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.4.4","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":"=1.0.0","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"mocha":"*","testosterone":"1.2.0","gently":"git://github.com/masylum/node-gently.git"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_npmUser":{"name":"masylum","email":"masylum@gmail.com"},"_id":"mongolia@1.4.4","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-2","_nodeVersion":"v0.6.5","_defaultsLoaded":true,"dist":{"shasum":"4e30c0bf074c933d26568699242cf9cf6ebbcc6c","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.4.4.tgz","integrity":"sha512-gjfez6TphPPkIiJCguVonEJa1Cw5pUzkGxmddOOrdQOeuzbN1wYm8zM3CHkl9IPq5iifxsGSeANWvhWcveoQDw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG7bviTXr4rRaO2l06T84c71GKeooRLUNzbjiXLlHQe/AiAvllKHvmFGlYRiW+6RT/jQ82hK5C3ZYACCfydMt6hFbQ=="}]},"readme":"    ooo        ooooo                                            oooo   o8o\n    `88.       .888'                                            `888   `\"'\n     888b     d'888   .ooooo.  ooo. .oo.    .oooooooo  .ooooo.   888  oooo   .oooo.\n     8 Y88. .P  888  d88' `88b `888P\"Y88b  888' `88b  d88' `88b  888  `888  `P  )88b\n     8  `888'   888  888   888  888   888  888   888  888   888  888   888   .oP\"888\n     8    Y     888  888   888  888   888  `88bod8P'  888   888  888   888  d8(  888\n    o8o        o888o `Y8bod8P' o888o o888o `8oooooo.  `Y8bod8P' o888o o888o `Y888\"\"8o\n                                           d\"     YD\n                                           \"Y88888P'\n\n\nMongolia is a layer that sits on top of the mongo driver and helps you dealing with your data logic.\nMongolia is not an ORM. Models contains no state, just logic.\nMongolia contains no magic.\n\n## Install\n\n``` bash\nnpm install mongolia\n```\n\nMongolia contains two independent modules:\n\n  * `model`: An object representing a collection with some hooks of mongo calls.\n  * `validator`: An object that validates mongoDB documents and returns errors if found.\n\n# Model\n\nModels are attached to collections.\nModels don't map data from the db, they just define the logic.\n\n``` javascript\nvar USER = require('mongolia').model(db, 'users');\n```\n\n## mongo proxied collection commands\n\nCalls to the db are done using the method `mongo`.\n`mongo` proxies all the `collection` methods defined on the driver plus some custom methods.\n\nThis allows mongolia to extend the driver with extra functionalties:\n\n  * Namespacing: Allows you to filter the documents going and coming from the db.\n  * Mapping: Allows you to apply functions to the documents attributes going and coming from the db.\n  * Hooks: They are triggered before and after a call is done.\n\nThe default usage is:\n\n`mongo('method[:namespace]', args)`\n\nIf you want to disable any functionality you can by doing:\n\n`mongo({method: method[, namespace: namespace, namespacing: false, mapping: false, hooks: false])`\n\nExample:\n``` javascript\nvar Db = require('mongodb/lib/mongodb/db').Db,\n    Server = require('mongodb/lib/mongodb/connection').Server,\n    db = new Db('blog', new Server('localhost', 27017, {auto_reconnect: true, native_parser: true}));\n\ndb.open(function () {\n  var User = require('./user.js')(db);\n\n  User.mongo('findOne', {name: 'foo'}, console.log);\n  User.mongo({method: 'insert', hooks: false}, {name: 'foo'}, console.log);\n});\n```\n\nAll the `collection` methods from the driver are supported.\n\nIf you need more information visit the [driver](http://github.com/christkv/node-mongodb-native) documentation\n\n### Custom mongo collection commands\n\nMongolia provides some useful commands that are not available using the driver.\n\n  * `findArray`: find that returns an array instead of a cursor.\n  * `mapReduceArray`: mapReduce that returns an array with the results.\n  * `mapReduceCursor`: mapReduce that returns a cursor.\n\n### Namespacing\n\nSecure your data access defining visibility namespaces.\n\nYou can namespace a call to the database by appending `:namespace` on\nyour proxied method.\n\nIf called without a namespace, the method will work ignoring the `namespace` directives.\n\nYou can `extend` other namespaces and `add` or `remove` some data visibility.\n\n``` javascript\nvar USER = require('mongolia').model(db, 'users');\n\nUSER.namespaces = {\n  public: ['account.email', 'account.name', '_id'],\n  private: {\n    extend: 'public',\n    add: ['password'],\n  },\n  accounting: {\n    extend: 'private',\n    add: ['credit_card_number'] // don't do this at home\n  }\n};\n\nUSER.mongo('insert:public', {account: {email: 'foo@bar.com'}, password: 'fleiba', credit_card_number: 123, is_active: true});\n// insert => {account: {email: 'foo@bar.com'}}\n\nUSER.validateAndUpdate({account: {email: 'foo@bar.com'}}, {'$set': {'account.email': 'super@mail.com', password: '123'}, {namespace: 'public'});\n// updates => {'$set': {'account.email': 'super@mail.com'}}\n\nUSER.mongo('findArray:public', {account: {email: 'foo@bar.com'}});\n// find => {account: {email: 'foo@bar.com', name: 'paco'}}\n\nUSER.mongo('findArray:accounting', {account: {email: 'foo@bar.com'}});\n// find => {account: {email: 'foo@bar.com', name: 'paco'}, password: 'fleiba', credit_card_number: 123}\n```\n\nUse this feature wisely to filter data coming from forms.\n\n### Mappings and type casting\n\nMongolia `maps` allows you to cast the data before is stored to the database.\nMongolia will apply the specified function for each attribute on the `maps` object.\n\nBy default we provide the map `_id -> ObjectId`, so you don't need to cast it.\n\n``` javascript\nvar USER = require('mongolia').model(db, 'users');\n\nUSER.maps = {\n  _id: ObjectID,\n  account: {\n    email: String,\n    name: function (val) {val.toUpperCase()}\n  },\n  password: String,\n  salt: String,\n  is_deleted: Boolean\n};\n\nUSER.mongo('insert', {email: 'foo@bar.com', password: 123, name: 'john', is_deleted: 'true'});\n// stored => {password: '123', name: 'JOHN', is_deleted: true}\n```\n\n### Hooks\n\nMongolia let you define some hooks on your models that will be triggered after a mongoDB command.\n\n  * `beforeInsert(documents, callback)`: triggered *before* an `insert`.\n  * `afterInsert(documents, callback)`: triggered *after* an `insert.\n\n  * `beforeUpdate(query, update, callback)`: triggered *before* an `update` or `findAndModify` command.\n  * `afterUpdate(query, update, callback)`: triggered *after* an `update` or `findAndModify` command.\n\n  * `beforeRemove(query, callback)`: triggered *before* a `remove` command.\n  * `afterRemove(query, callback)`: triggered *after* a `remove` command.\n\nExample:\n\n``` javascript\nvar COMMENT = require('mongolia').model(db, 'comments'),\n    Post = require('./post');\n\nCOMMENT.beforeInsert = function (documents, callback) {\n  documents.forEach(function (doc) {\n    doc.created_at = new Date();\n  });\n  callback(null, documents);\n};\n\nCOMMENT.atferInsert = function (documents, callback) {\n  documents.forEach(function (doc) {\n    Post(db).mongo('update', {_id: doc.post._id}, {'$inc': {num_posts: 1}}); // fire and forget\n  });\n  callback(null, documents);\n};\n\nUSER.mongo('insert', {email: 'foo@bar.com'});\n// stored => {email: 'foo@bar.com', created_at: Thu, 14 Jul 2011 12:13:39 GMT}\n// Post#num_posts is increased\n```\n\n## Embedded documents\n\nMongolia helps you to _denormalize_ your mongo database.\n\n### getEmbeddedDocument\n\nFilters document following the `skeletons` attribute.\n\n    getEmbeddedDocument(name, object, scope [, dot_notation]);\n\nExample:\n\n``` javascript\nvar POST = require('mongolia').model(db, 'posts');\n\n// only embed the comment's _id, and title\nPOST.skeletons = {\n  comment: ['_id', 'title', 'post.name']\n};\n\nvar comment = {'_id': 1, title: 'foo', body: 'Lorem ipsum', post: {_id: 1, name: 'bar'}}\nconsole.log(Post(db).getEmbeddedDocument('comment', comment));\n// outputs => {'_id': 1, title: 'foo', post: {name: 'bar'}};\n\nconsole.log(Post(db).getEmbeddedDocument('comment', comment, 'post'));\n// outputs => {post: {'_id': 1, title: 'foo', post: {name: 'bar'}}};\n\nconsole.log(Post(db).getEmbeddedDocument('comment', comment, 'posts', true));\n// outputs => {'posts._id': 1, 'posts.title': 'foo', 'posts.post.name': 'bar'};\n```\n\n### updateEmbeddedDocument\n\nUpdates an embed object following the `skeletons` directive.\n\n``` javascript\nModel.updateEmbeddedDocument(query, document_name, document[, options, callback]);\n```\n\nExample:\n\n``` javascript\nmodule.exports = function (db) {\n  var USER = require('mongolia').model(db, 'users');\n\n  // After updating a user, we want to update denormalized Post.author foreach post\n  USER.afterUpdate = function (query, update, callback) {\n    Post(db).updateEmbeddedDocument({_id: query._id}, 'author', update, {upsert: false}, callback);\n  };\n\n  return USER;\n};\n```\n\n### pushEmbeddedDocument\n\nPushes an embedded document following the `skeletons` directive.\n\n``` javascript\nModel.pushEmbeddedDocument(query, data, name[, options, callback]);\n```\n\nExample:\n\n``` javascript\nmodule.exports = function (db) {\n  var POST = require('mongolia')(db, 'posts');\n\n  // After inserting a post, we want to push it to `users.posts[]`\n  POST.afterInsert = function (documents, callback) {\n    User(db).pushEmbeddedDocument({_id: documents[0].author._id}, 'posts', document, callback);\n  };\n\n  return POST;\n}\n```\n\n## Create and update using validations\n\nMongolia provides two methods that allow you to create and update using the `validator`.\n\n``` javascript\nModel.validateAndInsert(document[, options, callback(error, validator)]);\nModel.validateAndUpdate(document, update[, options, callback(error, validator)]);\n```\n\nTo scope the insert/update within a namespace, use `options.namespace`.\n\nIn order to validate an insertion/update, the model have to implement a `validate` function on your model.\n\n``` javascript\nvalidate(query, update, callback);\n```\n\nExample:\n\n``` javascript\n// post.js\nmodule.exports = function (db) {\n  var POST = require('mongolia').model(db, 'posts');\n\n  POST.validate = function (query, update, callback) {\n    var validator = require('mongolia').validator(query, update);\n\n    validator.validateRegex({\n      title: [validator.regex.title, 'Incorrect title'],\n      body: [/.{4,200}/, 'Incorrect body'],\n    });\n\n    if (!update.body === 'Lorem ipsum') {\n      validator.addError('body', 'You can be a little bit more creative');\n    }\n\n    callback(null, validator);\n  }\n\n  return POST;\n};\n\n// app.js\nvar Post = require('./post.js');\n\nPost(db).validateAndInsert(\n  {title: 'This is a post', body: 'Lorem ipsum'},\n  function (error, validator) {\n    if (validator.hasErrors()) {\n      console.log(validator.errors);\n    } else {\n      console.log(validator.updated_document);\n    }\n  }\n);\n```\n\n# Validator\n\nMongolia validator accepts a document and an update.\n\nIf you are validating an insert, the document will be an empty object `{}` and the update\nthe document you are inserting.\n\nMongolia will resolve the update client side exposing a `updated_document`.\n\n``` javascript\nvar validator = require('mongolia').validator({foo: 1}, {'$inc': {foo: 1}});\n\nif (validator.updated_document.foo > 1) {\n  validator.addError('foo', 'foo must be ONE');\n}\nconsole.log(validator.hasError('foo')); // => true\n```\n\nAll the methods listed below accept `dot_notation`.\n\n## API\n\nReturns true if the validator is handling an updateInstance operation.\n\n``` javascript\nisUpdating()\n```\n\nReturns true if the validator is handling an createInstance operation.\n\n``` javascript\nisInserting()\n```\n\nReturns true if the attributed changed\n\n``` javascript\nattrChanged(attr)\n```\n\nAdds an error to your validator. Accept dot notation to add nested errors.\n\n``` javascript\naddError(field, value)\n```\n\nReturns true if the attributed failed a validation. Accept dot notation to check nested errors.\n\n``` javascript\nhasError(field)\n```\n\nReturns true if any attributed failed a validation\n\n``` javascript\nhasErrors()\n```\n\nIt fills your validator with errors if any of the elements are empty\n\n``` javascript\nvalidateExistence({\n  attr: 'Error message'\n, attr: ...\n})\n```\n\nIt fills your validator with errors if any of the elements fail the regex\n\n``` javascript\nvalidateRegex({\n  attr: [/regex/, 'Error message']\n, attr: ...\n})\n```\n\nIt fills your validator with errors if any of the elements fail the confirmation (good for passwords)\n\n``` javascript\nvalidateConfirmation({\n  attr: ['confirmation_attr', 'Error message']\n, attr: ...\n})\n```\n\nIt fills your validator with errors if any of the queries fail (good to avoid duplicated data)\n\n``` javascript\nvalidateQuery({\n  attr: [Model, query, false, 'Error message']\n, attr: ...\n}, callback)\n```\n\nExample using some of the validator features:\n\n``` javascript\nvar User = function (db) {\n  var USER = require('mongolia').model(db, 'users');\n\n  USER.validate = function (document, update, callback) {\n    var validator = require('mongolia').validator(document, update)\n      , updated_document = validator.updated_document;\n\n    validator.validateRegex({\n      name: [validator.regex.username, 'Incorrect name'],\n      email: [validator.regex.email, 'Incorrect email'],\n      password: [validator.regex.password, 'Incorrect password'],\n      description: [validator.regex.description, 'Incorrect description']\n    });\n\n    if (validator.attrChanged('password')) {\n      validator.validateConfirmation({\n        'password': ['password_confirmation', 'Passwords must match']\n      });\n    }\n\n    if (!updated_document.tags || updated_document.tags.length <= 0) {\n      validator.addError('tags', 'Select at least one tag');\n    }\n\n    validator.validateQuery({\n      email: [\n        this\n      , {_id: {'$not': document._id}, email: updated_document.email}\n      , false\n      , 'There is already a user with this email'\n      ]\n    }, function () {\n      callback(null, validator);\n    });\n  }\n\n  return USER;\n};\n```\n\n## Tests\n\nMongolia is fully tested using [testosterone](http://github.com/masylum/testosterone)\nTo run the tests use:\n\n```bash\nmake\n```\n\n## Example\n\nMonoglia has a fully working blog example on the `example` folder.\n\n## Contributors\n\nIn no specific order.\n\n  * Josep M. Bach ([txus](http://github.com/txus))\n  * Pau Ramon ([masylum](http://github.com/masylum))\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2010-2011 Pau Ramon Revilla &lt;masylum@gmail.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","maintainers":[{"name":"masylum","email":"masylum@gmail.com"}]},"1.5.0":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.5.0","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":"=1.0.1","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"mocha":"*","testosterone":"1.2.0","sinon":"1.3.4"},"repository":{"type":"git","url":"git://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"_npmUser":{"name":"masylum","email":"masylum@gmail.com"},"_id":"mongolia@1.5.0","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-2","_nodeVersion":"v0.6.5","_defaultsLoaded":true,"dist":{"shasum":"a634c09a18809d4f346a64e6a4811681c3924ae5","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.5.0.tgz","integrity":"sha512-onOrezVBoYNAOKlP4OT7zkpmBLWaRZP9eLP72t3xIPkRfI3LGUAYO1tYTKvozoHVl69Rjy4/Jq2nJx5xFenQkw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD07r9b3S3L8WyD54qZ8siSIwXMhvOv1DsENkCGCo9p/wIhAKvWiA6ovhR/4BPXJYKqmKl4TUYXxULjf6rDQd2KTx29"}]},"readme":"    ooo        ooooo                                            oooo   o8o\n    `88.       .888'                                            `888   `\"'\n     888b     d'888   .ooooo.  ooo. .oo.    .oooooooo  .ooooo.   888  oooo   .oooo.\n     8 Y88. .P  888  d88' `88b `888P\"Y88b  888' `88b  d88' `88b  888  `888  `P  )88b\n     8  `888'   888  888   888  888   888  888   888  888   888  888   888   .oP\"888\n     8    Y     888  888   888  888   888  `88bod8P'  888   888  888   888  d8(  888\n    o8o        o888o `Y8bod8P' o888o o888o `8oooooo.  `Y8bod8P' o888o o888o `Y888\"\"8o\n                                           d\"     YD\n                                           \"Y88888P'\n\n\nMongolia is a thin layer that sits on top of the mongo native driver and helps you dealing with your data logic.\nMongolia is not an ORM. Models contains no state, just logic.\nMongolia contains no magic.\n\n## Install\n\n``` bash\nnpm install mongolia\n```\n\nMongolia contains two independent modules:\n\n  * `model`: An object representing a collection with some hooks of mongo calls.\n  * `validator`: An object that validates mongoDB documents and returns errors if found.\n\n# Model\n\nModels are attached to collections.\nModels don't map data from the db, they just define the logic.\n\n``` javascript\nvar USER = require('mongolia').model(db, 'users');\n```\n\n## mongo proxied collection commands\n\nCalls to the db are done using the method `mongo`.\n`mongo` proxies all the `collection` methods defined on the driver plus some custom methods.\n\nThis allows mongolia to extend the driver with extra functionalties:\n\n  * Namespacing: Allows you to filter the documents going and coming from the db.\n  * Mapping: Allows you to apply functions to the documents attributes going and coming from the db.\n  * Hooks: They are triggered before and after a call is done.\n\nThere are two APIs:\n\n`mongo('method[:namespace]', args)`\n\n and\n\n`mongo({method: method[, namespace: namespace, namespacing: false, mapping: false, hooks: false])`\n\nExample:\n``` javascript\nvar Db = require('mongodb/lib/mongodb/db').Db,\n    Server = require('mongodb/lib/mongodb/connection').Server,\n    db = new Db('blog', new Server('localhost', 27017, {auto_reconnect: true, native_parser: true}));\n\ndb.open(function () {\n  var User = require('./user.js')(db);\n\n  User.mongo('findOne', {name: 'foo'}, console.log);\n  User.mongo({method: 'insert', hooks: false}, {name: 'foo'}, console.log);\n});\n```\n\nAll the `collection` methods from the driver are supported and have a shortcut so you can use Mongolia\nlike the native driver (with the advantage of not having to ask for the collection):\n\nExample:\n``` javascript\n  User.findOne({name: 'foo'}, console.log);\n  User.insert({name: 'foo'}); // fire and forget\n});\n```\n\nIf you need more information on collection methods\nvisit the [driver](https://github.com/mongodb/node-mongodb-native) documentation\n\n### Custom mongo collection commands\n\nMongolia provides some useful commands that are not available using the driver.\n\n  * `findArray`: find that returns an array instead of a cursor.\n  * `mapReduceArray`: mapReduce that returns an array with the results.\n  * `mapReduceCursor`: mapReduce that returns a cursor.\n\n### Namespacing\n\nSecure your data access defining visibility namespaces.\n\nYou can namespace a call to the database by appending `:namespace` on\nyour proxied method.\n\nIf called without a namespace, the method will work ignoring the `namespace` directives.\n\nYou can `extend` other namespaces and `add` or `remove` some data visibility.\n\n``` javascript\nvar USER = require('mongolia').model(db, 'users');\n\nUSER.namespaces = {\n  public: ['account.email', 'account.name', '_id'],\n  private: {\n    extend: 'public',\n    add: ['password'],\n  },\n  accounting: {\n    extend: 'private',\n    add: ['credit_card_number'] // don't do this at home\n  }\n};\n\nUSER.mongo('insert:public', {account: {email: 'foo@bar.com'}, password: 'fleiba', credit_card_number: 123, is_active: true});\n// insert => {account: {email: 'foo@bar.com'}}\n\nUSER.validateAndUpdate({account: {email: 'foo@bar.com'}}, {'$set': {'account.email': 'super@mail.com', password: '123'}, {namespace: 'public'});\n// updates => {'$set': {'account.email': 'super@mail.com'}}\n\nUSER.mongo('findArray:public', {account: {email: 'foo@bar.com'}});\n// find => {account: {email: 'foo@bar.com', name: 'paco'}}\n\nUSER.mongo('findArray:accounting', {account: {email: 'foo@bar.com'}});\n// find => {account: {email: 'foo@bar.com', name: 'paco'}, password: 'fleiba', credit_card_number: 123}\n```\n\nUse this feature wisely to filter data coming from forms.\n\n### Mappings and type casting\n\nMongolia `maps` allows you to cast the data before is stored to the database.\nMongolia will apply the specified function for each attribute on the `maps` object.\n\nBy default we provide the map `_id -> ObjectId`, so you don't need to cast it.\n\n``` javascript\nvar USER = require('mongolia').model(db, 'users');\n\nUSER.maps = {\n  _id: ObjectID,\n  account: {\n    email: String,\n    name: function (val) {val.toUpperCase()}\n  },\n  password: String,\n  salt: String,\n  is_deleted: Boolean\n};\n\nUSER.mongo('insert', {email: 'foo@bar.com', password: 123, name: 'john', is_deleted: 'true'});\n// stored => {password: '123', name: 'JOHN', is_deleted: true}\n```\n\n### Hooks\n\nMongolia let you define some hooks on your models that will be triggered after a mongoDB command.\n\n  * `beforeInsert(documents, callback)`: triggered *before* an `insert`.\n  * `afterInsert(documents, callback)`: triggered *after* an `insert.\n\n  * `beforeUpdate(query, update, callback)`: triggered *before* an `update` or `findAndModify` command.\n  * `afterUpdate(query, update, callback)`: triggered *after* an `update` or `findAndModify` command.\n\n  * `beforeRemove(query, callback)`: triggered *before* a `remove` command.\n  * `afterRemove(query, callback)`: triggered *after* a `remove` command.\n\nExample:\n\n``` javascript\nvar COMMENT = require('mongolia').model(db, 'comments'),\n    Post = require('./post');\n\nCOMMENT.beforeInsert = function (documents, callback) {\n  documents.forEach(function (doc) {\n    doc.created_at = new Date();\n  });\n  callback(null, documents);\n};\n\nCOMMENT.atferInsert = function (documents, callback) {\n  documents.forEach(function (doc) {\n    Post(db).mongo('update', {_id: doc.post._id}, {'$inc': {num_posts: 1}}); // fire and forget\n  });\n  callback(null, documents);\n};\n\nUSER.mongo('insert', {email: 'foo@bar.com'});\n// stored => {email: 'foo@bar.com', created_at: Thu, 14 Jul 2011 12:13:39 GMT}\n// Post#num_posts is increased\n```\n\n## Embedded documents\n\nMongolia helps you to _denormalize_ your mongo collections.\n\n### getEmbeddedDocument\n\nFilters document following the `skeletons` attribute.\n\n    getEmbeddedDocument(name, object, scope [, dot_notation]);\n\nExample:\n\n``` javascript\nvar POST = require('mongolia').model(db, 'posts');\n\n// only embed the comment's _id, and title\nPOST.skeletons = {\n  comment: ['_id', 'title', 'post.name']\n};\n\nvar comment = {'_id': 1, title: 'foo', body: 'Lorem ipsum', post: {_id: 1, name: 'bar'}}\nconsole.log(Post(db).getEmbeddedDocument('comment', comment));\n// outputs => {'_id': 1, title: 'foo', post: {name: 'bar'}};\n\nconsole.log(Post(db).getEmbeddedDocument('comment', comment, 'post'));\n// outputs => {post: {'_id': 1, title: 'foo', post: {name: 'bar'}}};\n\nconsole.log(Post(db).getEmbeddedDocument('comment', comment, 'posts', true));\n// outputs => {'posts._id': 1, 'posts.title': 'foo', 'posts.post.name': 'bar'};\n```\n\n### updateEmbeddedDocument\n\nUpdates an embed object following the `skeletons` directive.\n\n``` javascript\nModel.updateEmbeddedDocument(query, document_name, document[, options, callback]);\n```\n\nExample:\n\n``` javascript\nmodule.exports = function (db) {\n  var USER = require('mongolia').model(db, 'users');\n\n  // After updating a user, we want to update denormalized Post.author foreach post\n  USER.afterUpdate = function (query, update, callback) {\n    Post(db).updateEmbeddedDocument({_id: query._id}, 'author', update, {upsert: false}, callback);\n  };\n\n  return USER;\n};\n```\n\n### pushEmbeddedDocument\n\nPushes an embedded document following the `skeletons` directive.\n\n``` javascript\nModel.pushEmbeddedDocument(query, data, name[, options, callback]);\n```\n\nExample:\n\n``` javascript\nmodule.exports = function (db) {\n  var POST = require('mongolia')(db, 'posts');\n\n  // After inserting a post, we want to push it to `users.posts[]`\n  POST.afterInsert = function (documents, callback) {\n    User(db).pushEmbeddedDocument({_id: documents[0].author._id}, 'posts', document, callback);\n  };\n\n  return POST;\n}\n```\n\n## Create and update using validations\n\nMongolia provides two methods that allow you to create and update using the `validator`.\n\n``` javascript\nModel.validateAndInsert(document[, options, callback(error, validator)]);\nModel.validateAndUpdate(document, update[, options, callback(error, validator)]);\n```\n\nTo scope the insert/update within a namespace, use `options.namespace`.\n\nIn order to validate an insertion/update, the model have to implement a `validate` function on your model.\n\n``` javascript\nvalidate(query, update, callback);\n```\n\nExample:\n\n``` javascript\n// post.js\nmodule.exports = function (db) {\n  var POST = require('mongolia').model(db, 'posts');\n\n  POST.validate = function (query, update, callback) {\n    var validator = require('mongolia').validator(query, update);\n\n    validator.validateRegex({\n      title: [validator.regex.title, 'Incorrect title'],\n      body: [/.{4,200}/, 'Incorrect body'],\n    });\n\n    if (!update.body === 'Lorem ipsum') {\n      validator.addError('body', 'You can be a little bit more creative');\n    }\n\n    callback(null, validator);\n  }\n\n  return POST;\n};\n\n// app.js\nvar Post = require('./post.js');\n\nPost(db).validateAndInsert(\n  {title: 'This is a post', body: 'Lorem ipsum'},\n  function (error, validator) {\n    if (validator.hasErrors()) {\n      console.log(validator.errors);\n    } else {\n      console.log(validator.updated_document);\n    }\n  }\n);\n```\n\n# Validator\n\nMongolia validator accepts a document and an update.\n\nIf you are validating an insert, the document will be an empty object `{}` and the update\nthe document you are inserting.\n\nMongolia will resolve the update client side exposing a `updated_document`.\n\n``` javascript\nvar validator = require('mongolia').validator({foo: 1}, {'$inc': {foo: 1}});\n\nif (validator.updated_document.foo > 1) {\n  validator.addError('foo', 'foo must be ONE');\n}\nconsole.log(validator.hasError('foo')); // => true\n```\n\nAll the methods listed below accept `dot_notation`.\n\n## API\n\nReturns true if the validator is handling an updateInstance operation.\n\n``` javascript\nisUpdating()\n```\n\nReturns true if the validator is handling an createInstance operation.\n\n``` javascript\nisInserting()\n```\n\nReturns true if the attributed changed\n\n``` javascript\nattrChanged(attr)\n```\n\nAdds an error to your validator. Accept dot notation to add nested errors.\n\n``` javascript\naddError(field, value)\n```\n\nReturns true if the attributed failed a validation. Accept dot notation to check nested errors.\n\n``` javascript\nhasError(field)\n```\n\nReturns true if any attributed failed a validation\n\n``` javascript\nhasErrors()\n```\n\nIt fills your validator with errors if any of the elements are empty\n\n``` javascript\nvalidateExistence({\n  attr: 'Error message'\n, attr: ...\n})\n```\n\nIt fills your validator with errors if any of the elements fail the regex\n\n``` javascript\nvalidateRegex({\n  attr: [/regex/, 'Error message']\n, attr: ...\n})\n```\n\nIt fills your validator with errors if any of the elements fail the confirmation (good for passwords)\n\n``` javascript\nvalidateConfirmation({\n  attr: ['confirmation_attr', 'Error message']\n, attr: ...\n})\n```\n\nIt fills your validator with errors if any of the queries fail (good to avoid duplicated data)\n\n``` javascript\nvalidateQuery({\n  attr: [Model, query, false, 'Error message']\n, attr: ...\n}, callback)\n```\n\nExample using some of the validator features:\n\n``` javascript\nvar User = function (db) {\n  var USER = require('mongolia').model(db, 'users');\n\n  USER.validate = function (document, update, callback) {\n    var validator = require('mongolia').validator(document, update)\n      , updated_document = validator.updated_document;\n\n    validator.validateRegex({\n      name: [validator.regex.username, 'Incorrect name'],\n      email: [validator.regex.email, 'Incorrect email'],\n      password: [validator.regex.password, 'Incorrect password'],\n      description: [validator.regex.description, 'Incorrect description']\n    });\n\n    if (validator.attrChanged('password')) {\n      validator.validateConfirmation({\n        'password': ['password_confirmation', 'Passwords must match']\n      });\n    }\n\n    if (!updated_document.tags || updated_document.tags.length <= 0) {\n      validator.addError('tags', 'Select at least one tag');\n    }\n\n    validator.validateQuery({\n      email: [\n        this\n      , {_id: {'$not': document._id}, email: updated_document.email}\n      , false\n      , 'There is already a user with this email'\n      ]\n    }, function () {\n      callback(null, validator);\n    });\n  }\n\n  return USER;\n};\n```\n\n## Tests\n\nMongolia is fully tested using [mocha](http://github.com/visionmedia/mocha)\nTo run the tests use:\n\n```bash\nmake\n```\n\n## Example\n\nMongolia has a fully working blog example on the `example` folder.\n\n## Contributors\n\nIn no specific order.\n\n  * Josep M. Bach ([txus](http://github.com/txus))\n  * Pau Ramon ([masylum](http://github.com/masylum))\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2010-2011 Pau Ramon Revilla &lt;masylum@gmail.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","maintainers":[{"name":"masylum","email":"masylum@gmail.com"}]},"1.5.1":{"name":"mongolia","description":"Layer on top of the mongodb driver to implement data logic.","version":"1.5.1","author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"contributors":[{"name":"Pau Ramon","email":"masylum@gmail.com"},{"name":"Josep M. Bach","email":"josep.m.bach@gmail.com"}],"keywords":["mongo","mongodb","models","database","db"],"main":"./index","dependencies":{"mongodb":"=1.0.1","funk":"1.0.1","underscore":"1.1.6"},"devDependencies":{"mocha":"*","testosterone":"1.2.0","sinon":"1.3.4"},"repository":{"type":"git","url":"http://github.com/masylum/mongolia.git"},"engines":{"node":">= 0.4.0"},"readme":"    ooo        ooooo                                            oooo   o8o\n    `88.       .888'                                            `888   `\"'\n     888b     d'888   .ooooo.  ooo. .oo.    .oooooooo  .ooooo.   888  oooo   .oooo.\n     8 Y88. .P  888  d88' `88b `888P\"Y88b  888' `88b  d88' `88b  888  `888  `P  )88b\n     8  `888'   888  888   888  888   888  888   888  888   888  888   888   .oP\"888\n     8    Y     888  888   888  888   888  `88bod8P'  888   888  888   888  d8(  888\n    o8o        o888o `Y8bod8P' o888o o888o `8oooooo.  `Y8bod8P' o888o o888o `Y888\"\"8o\n                                           d\"     YD\n                                           \"Y88888P'\n\n\nMongolia is a thin layer that sits on top of the mongo native driver and helps you dealing with your data logic.\nMongolia is not an ORM. Models contains no state, just logic.\nMongolia contains no magic.\n\n## Install\n\n``` bash\nnpm install mongolia\n```\n\nMongolia contains two independent modules:\n\n  * `model`: An object representing a collection with some hooks of mongo calls.\n  * `validator`: An object that validates mongoDB documents and returns errors if found.\n\n# Model\n\nModels are attached to collections.\nModels don't map data from the db, they just define the logic.\n\n``` javascript\nvar USER = require('mongolia').model(db, 'users');\n```\n\n## mongo proxied collection commands\n\nCalls to the db are done using the method `mongo`.\n`mongo` proxies all the `collection` methods defined on the driver plus some custom methods.\n\nThis allows mongolia to extend the driver with extra functionalties:\n\n  * Namespacing: Allows you to filter the documents going and coming from the db.\n  * Mapping: Allows you to apply functions to the documents attributes going and coming from the db.\n  * Hooks: They are triggered before and after a call is done.\n\nThere are two APIs:\n\n`mongo('method[:namespace]', args)`\n\n and\n\n`mongo({method: method[, namespace: namespace, namespacing: false, mapping: false, hooks: false])`\n\nExample:\n``` javascript\nvar Db = require('mongodb/lib/mongodb/db').Db,\n    Server = require('mongodb/lib/mongodb/connection').Server,\n    db = new Db('blog', new Server('localhost', 27017, {auto_reconnect: true, native_parser: true}));\n\ndb.open(function () {\n  var User = require('./user.js')(db);\n\n  User.mongo('findOne', {name: 'foo'}, console.log);\n  User.mongo({method: 'insert', hooks: false}, {name: 'foo'}, console.log);\n});\n```\n\nAll the `collection` methods from the driver are supported and have a shortcut so you can use Mongolia\nlike the native driver (with the advantage of not having to ask for the collection):\n\nExample:\n``` javascript\n  User.findOne({name: 'foo'}, console.log);\n  User.insert({name: 'foo'}); // fire and forget\n});\n```\n\nIf you need more information on collection methods\nvisit the [driver](https://github.com/mongodb/node-mongodb-native) documentation\n\n### Custom mongo collection commands\n\nMongolia provides some useful commands that are not available using the driver.\n\n  * `findArray`: find that returns an array instead of a cursor.\n  * `mapReduceArray`: mapReduce that returns an array with the results.\n  * `mapReduceCursor`: mapReduce that returns a cursor.\n\n### Namespacing\n\nSecure your data access defining visibility namespaces.\n\nYou can namespace a call to the database by appending `:namespace` on\nyour proxied method.\n\nIf called without a namespace, the method will work ignoring the `namespace` directives.\n\nYou can `extend` other namespaces and `add` or `remove` some data visibility.\n\n``` javascript\nvar USER = require('mongolia').model(db, 'users');\n\nUSER.namespaces = {\n  public: ['account.email', 'account.name', '_id'],\n  private: {\n    extend: 'public',\n    add: ['password'],\n  },\n  accounting: {\n    extend: 'private',\n    add: ['credit_card_number'] // don't do this at home\n  }\n};\n\nUSER.mongo('insert:public', {account: {email: 'foo@bar.com'}, password: 'fleiba', credit_card_number: 123, is_active: true});\n// insert => {account: {email: 'foo@bar.com'}}\n\nUSER.validateAndUpdate({account: {email: 'foo@bar.com'}}, {'$set': {'account.email': 'super@mail.com', password: '123'}, {namespace: 'public'});\n// updates => {'$set': {'account.email': 'super@mail.com'}}\n\nUSER.mongo('findArray:public', {account: {email: 'foo@bar.com'}});\n// find => {account: {email: 'foo@bar.com', name: 'paco'}}\n\nUSER.mongo('findArray:accounting', {account: {email: 'foo@bar.com'}});\n// find => {account: {email: 'foo@bar.com', name: 'paco'}, password: 'fleiba', credit_card_number: 123}\n```\n\nUse this feature wisely to filter data coming from forms.\n\n### Mappings and type casting\n\nMongolia `maps` allows you to cast the data before is stored to the database.\nMongolia will apply the specified function for each attribute on the `maps` object.\n\nBy default we provide the map `_id -> ObjectId`, so you don't need to cast it.\n\n``` javascript\nvar USER = require('mongolia').model(db, 'users');\n\nUSER.maps = {\n  _id: ObjectID,\n  account: {\n    email: String,\n    name: function (val) {val.toUpperCase()}\n  },\n  password: String,\n  salt: String,\n  is_deleted: Boolean\n};\n\nUSER.mongo('insert', {email: 'foo@bar.com', password: 123, name: 'john', is_deleted: 'true'});\n// stored => {password: '123', name: 'JOHN', is_deleted: true}\n```\n\n### Hooks\n\nMongolia let you define some hooks on your models that will be triggered after a mongoDB command.\n\n  * `beforeInsert(documents, callback)`: triggered *before* an `insert`.\n  * `afterInsert(documents, callback)`: triggered *after* an `insert.\n\n  * `beforeUpdate(query, update, callback)`: triggered *before* an `update` or `findAndModify` command.\n  * `afterUpdate(query, update, callback)`: triggered *after* an `update` or `findAndModify` command.\n\n  * `beforeRemove(query, callback)`: triggered *before* a `remove` command.\n  * `afterRemove(query, callback)`: triggered *after* a `remove` command.\n\nExample:\n\n``` javascript\nvar COMMENT = require('mongolia').model(db, 'comments'),\n    Post = require('./post');\n\nCOMMENT.beforeInsert = function (documents, callback) {\n  documents.forEach(function (doc) {\n    doc.created_at = new Date();\n  });\n  callback(null, documents);\n};\n\nCOMMENT.afterInsert = function (documents, callback) {\n  documents.forEach(function (doc) {\n    Post(db).mongo('update', {_id: doc.post._id}, {'$inc': {num_posts: 1}}); // fire and forget\n  });\n  callback(null, documents);\n};\n\nUSER.mongo('insert', {email: 'foo@bar.com'});\n// stored => {email: 'foo@bar.com', created_at: Thu, 14 Jul 2011 12:13:39 GMT}\n// Post#num_posts is increased\n```\n\n## Embedded documents\n\nMongolia helps you to _denormalize_ your mongo collections.\n\n### getEmbeddedDocument\n\nFilters document following the `skeletons` attribute.\n\n    getEmbeddedDocument(name, object, scope [, dot_notation]);\n\nExample:\n\n``` javascript\nvar POST = require('mongolia').model(db, 'posts');\n\n// only embed the comment's _id, and title\nPOST.skeletons = {\n  comment: ['_id', 'title', 'post.name']\n};\n\nvar comment = {'_id': 1, title: 'foo', body: 'Lorem ipsum', post: {_id: 1, name: 'bar'}}\nconsole.log(Post(db).getEmbeddedDocument('comment', comment));\n// outputs => {'_id': 1, title: 'foo', post: {name: 'bar'}};\n\nconsole.log(Post(db).getEmbeddedDocument('comment', comment, 'post'));\n// outputs => {post: {'_id': 1, title: 'foo', post: {name: 'bar'}}};\n\nconsole.log(Post(db).getEmbeddedDocument('comment', comment, 'posts', true));\n// outputs => {'posts._id': 1, 'posts.title': 'foo', 'posts.post.name': 'bar'};\n```\n\n### updateEmbeddedDocument\n\nUpdates an embed object following the `skeletons` directive.\n\n``` javascript\nModel.updateEmbeddedDocument(query, document_name, document[, options, callback]);\n```\n\nExample:\n\n``` javascript\nmodule.exports = function (db) {\n  var USER = require('mongolia').model(db, 'users');\n\n  // After updating a user, we want to update denormalized Post.author foreach post\n  USER.afterUpdate = function (query, update, callback) {\n    Post(db).updateEmbeddedDocument({_id: query._id}, 'author', update, {upsert: false}, callback);\n  };\n\n  return USER;\n};\n```\n\n### pushEmbeddedDocument\n\nPushes an embedded document following the `skeletons` directive.\n\n``` javascript\nModel.pushEmbeddedDocument(query, data, name[, options, callback]);\n```\n\nExample:\n\n``` javascript\nmodule.exports = function (db) {\n  var POST = require('mongolia')(db, 'posts');\n\n  // After inserting a post, we want to push it to `users.posts[]`\n  POST.afterInsert = function (documents, callback) {\n    User(db).pushEmbeddedDocument({_id: documents[0].author._id}, 'posts', document, callback);\n  };\n\n  return POST;\n}\n```\n\n## Create and update using validations\n\nMongolia provides two methods that allow you to create and update using the `validator`.\n\n``` javascript\nModel.validateAndInsert(document[, options, callback(error, validator)]);\nModel.validateAndUpdate(document, update[, options, callback(error, validator)]);\n```\n\nTo scope the insert/update within a namespace, use `options.namespace`.\n\nIn order to validate an insertion/update, the model have to implement a `validate` function on your model.\n\n``` javascript\nvalidate(query, update, callback);\n```\n\nExample:\n\n``` javascript\n// post.js\nmodule.exports = function (db) {\n  var POST = require('mongolia').model(db, 'posts');\n\n  POST.validate = function (query, update, callback) {\n    var validator = require('mongolia').validator(query, update);\n\n    validator.validateRegex({\n      title: [validator.regex.title, 'Incorrect title'],\n      body: [/.{4,200}/, 'Incorrect body'],\n    });\n\n    if (!update.body === 'Lorem ipsum') {\n      validator.addError('body', 'You can be a little bit more creative');\n    }\n\n    callback(null, validator);\n  }\n\n  return POST;\n};\n\n// app.js\nvar Post = require('./post.js');\n\nPost(db).validateAndInsert(\n  {title: 'This is a post', body: 'Lorem ipsum'},\n  function (error, validator) {\n    if (validator.hasErrors()) {\n      console.log(validator.errors);\n    } else {\n      console.log(validator.updated_document);\n    }\n  }\n);\n```\n\n# Validator\n\nMongolia validator accepts a document and an update.\n\nIf you are validating an insert, the document will be an empty object `{}` and the update\nthe document you are inserting.\n\nMongolia will resolve the update client side exposing a `updated_document`.\n\n``` javascript\nvar validator = require('mongolia').validator({foo: 1}, {'$inc': {foo: 1}});\n\nif (validator.updated_document.foo > 1) {\n  validator.addError('foo', 'foo must be ONE');\n}\nconsole.log(validator.hasError('foo')); // => true\n```\n\nAll the methods listed below accept `dot_notation`.\n\n## API\n\nReturns true if the validator is handling an updateInstance operation.\n\n``` javascript\nisUpdating()\n```\n\nReturns true if the validator is handling an createInstance operation.\n\n``` javascript\nisInserting()\n```\n\nReturns true if the attributed changed\n\n``` javascript\nattrChanged(attr)\n```\n\nAdds an error to your validator. Accept dot notation to add nested errors.\n\n``` javascript\naddError(field, value)\n```\n\nReturns true if the attributed failed a validation. Accept dot notation to check nested errors.\n\n``` javascript\nhasError(field)\n```\n\nReturns true if any attributed failed a validation\n\n``` javascript\nhasErrors()\n```\n\nIt fills your validator with errors if any of the elements are empty\n\n``` javascript\nvalidateExistence({\n  attr: 'Error message'\n, attr: ...\n})\n```\n\nIt fills your validator with errors if any of the elements fail the regex\n\n``` javascript\nvalidateRegex({\n  attr: [/regex/, 'Error message']\n, attr: ...\n})\n```\n\nIt fills your validator with errors if any of the elements fail the confirmation (good for passwords)\n\n``` javascript\nvalidateConfirmation({\n  attr: ['confirmation_attr', 'Error message']\n, attr: ...\n})\n```\n\nIt fills your validator with errors if any of the queries fail (good to avoid duplicated data)\n\n``` javascript\nvalidateQuery({\n  attr: [Model, query, false, 'Error message']\n, attr: ...\n}, callback)\n```\n\nExample using some of the validator features:\n\n``` javascript\nvar User = function (db) {\n  var USER = require('mongolia').model(db, 'users');\n\n  USER.validate = function (document, update, callback) {\n    var validator = require('mongolia').validator(document, update)\n      , updated_document = validator.updated_document;\n\n    validator.validateRegex({\n      name: [validator.regex.username, 'Incorrect name'],\n      email: [validator.regex.email, 'Incorrect email'],\n      password: [validator.regex.password, 'Incorrect password'],\n      description: [validator.regex.description, 'Incorrect description']\n    });\n\n    if (validator.attrChanged('password')) {\n      validator.validateConfirmation({\n        'password': ['password_confirmation', 'Passwords must match']\n      });\n    }\n\n    if (!updated_document.tags || updated_document.tags.length <= 0) {\n      validator.addError('tags', 'Select at least one tag');\n    }\n\n    validator.validateQuery({\n      email: [\n        this\n      , {_id: {'$not': document._id}, email: updated_document.email}\n      , false\n      , 'There is already a user with this email'\n      ]\n    }, function () {\n      callback(null, validator);\n    });\n  }\n\n  return USER;\n};\n```\n\n## Tests\n\nMongolia is fully tested using [mocha](http://github.com/visionmedia/mocha)\nTo run the tests use:\n\n```bash\nmake\n```\n\n## Example\n\nMongolia has a fully working blog example on the `example` folder.\n\n## Contributors\n\nIn no specific order.\n\n  * Josep M. Bach ([txus](http://github.com/txus))\n  * Pau Ramon ([masylum](http://github.com/masylum))\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2010-2011 Pau Ramon Revilla &lt;masylum@gmail.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"mongolia@1.5.1","dist":{"shasum":"8f2a53ae5927478b4df7ab9e99cb89c68b580799","tarball":"https://registry.npmjs.org/mongolia/-/mongolia-1.5.1.tgz","integrity":"sha512-wvsryzh7rKiykFOGEFjRBjI3v7WvrYYeBGey17qqkExK9+3yp8LRT9aMhfPYOjep6DJ9me8gLbOfr7MG0OCH3Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAUpkiR0U8vjpiNvmvEGIsxQ5Tuqj2y+Kjl8I00EYTRQAiAdOO5/7pYXyp/b+PhLGv7xrdHwh3TaWMYpBtYiDpFosg=="}]},"maintainers":[{"name":"masylum","email":"masylum@gmail.com"}]}},"maintainers":[{"name":"masylum","email":"masylum@gmail.com"}],"author":{"name":"Pau Ramon","email":"masylum@gmail.com"},"repository":{"type":"git","url":"http://github.com/masylum/mongolia.git"},"time":{"modified":"2022-06-20T06:44:25.544Z","created":"2011-01-02T16:36:38.930Z","0.0.1":"2011-01-02T16:36:38.930Z","0.0.2":"2011-01-02T16:36:38.930Z","0.0.3":"2011-01-02T16:36:38.930Z","0.0.4":"2011-01-02T16:36:38.930Z","0.0.5":"2011-01-02T16:36:38.930Z","0.0.6":"2011-01-02T16:36:38.930Z","0.0.7":"2011-01-02T16:36:38.930Z","0.0.8":"2011-01-02T16:36:38.930Z","0.0.9":"2011-01-02T23:01:55.499Z","0.0.10":"2011-01-22T10:10:05.989Z","1.0.0":"2011-05-08T23:28:17.897Z","1.0.1":"2011-05-25T11:31:15.367Z","1.1.0":"2011-05-30T12:55:59.174Z","1.2.0":"2011-05-31T09:45:32.908Z","1.2.2":"2011-06-03T12:16:12.310Z","1.2.3":"2011-06-03T13:10:57.416Z","1.2.4":"2011-06-04T12:40:52.640Z","1.2.5":"2011-06-08T08:56:43.892Z","1.2.6":"2011-06-08T09:11:53.747Z","1.2.7":"2011-06-08T09:51:19.084Z","1.2.8":"2011-06-08T12:09:35.790Z","1.2.9":"2011-06-08T12:28:00.360Z","1.3.0":"2011-06-09T11:10:25.122Z","1.3.1":"2011-06-12T10:56:51.980Z","1.3.2":"2011-06-14T22:58:02.187Z","1.3.3":"2011-06-15T09:06:28.940Z","1.3.4":"2011-07-12T18:34:25.527Z","1.3.5":"2011-07-13T20:12:34.302Z","1.4.0":"2011-07-14T12:26:08.245Z","1.4.1":"2011-07-20T16:50:04.832Z","1.4.2":"2011-08-03T22:03:49.162Z","1.4.3":"2011-08-08T14:50:45.548Z","1.4.4":"2012-05-08T08:11:04.509Z","1.5.0":"2012-05-13T14:38:55.551Z","1.5.1":"2012-12-03T14:02:52.481Z"}}