Mabolo icon indicating copy to clipboard operation
Mabolo copied to clipboard

Just a simple ORM of MongoDB API.

Results 5 Mabolo issues
Sort by recently updated
recently updated
newest added

This project has vulnerabilities that could not be fixed, or were patched when no upgrade was available. Good news, new upgrades or patches have now been published! This pull request...

根据在 https://github.com/jysperm/Mabolo/issues/4 提到的,`.find()` 需要同步返回一个 Cursor 实例,但必须调用 MongoDB Collection 的 find 方法才能得到 Cursor 实例,而在 MongoClient.connect 的回调中才能从 Db 得到 Collection. 所以需要像对于 MaboloCollection 访问 Collection 的那样去处理 Cursor.

因为从最初编写 Mabolo 以来,我对 MongoDB 的了解又深入了许多,同时 Mabolo 也切换到了 MongoDB Driver 2.x for Node.js, 需要对基本 API 做一些修改(不包括嵌入式文档)。 原 AbstractModel 将被拆分成 MaboloCollection 和 MaboloDocument, 分别包含静态方法和实例方法。 ## Mabolo 这部分几乎没什么变化,不过 schema 改成了通过 Joi Schema 来定义。...

- [ ] 重构文件结构,拆分原来的单个文件为 mabolo, document, model, utils 几个文件 - [ ] 梳理单元测试,设计一个统一的数据集来进行单元测试 - [ ] 暂时去除和嵌入式文档有关的代码,等待下个版本继续重写 - [ ] #2 使用 Joi 完成文档的验证 - [ ] #4 借此机会重新设计基本 API

https://github.com/hapijs/joi 一个示例: ``` Mabolo = require '../../index' Joi = require 'joi' Account = Mabolo.model 'Account', Joi.object username: Joi.string().required().token() email: Joi.string().required().email() hasedPassword: Joi.string() passwordSalt: Joi.string() groups: Joi.array().items Joi.string().allow ['root', 'admin'] preferences:...