Skip to main content

a package use orm to operate mongo

Project description

### mongorm
一个简单的基于pymongo的orm

### 使用示例


```python
from mongorm import MongoModel
from field import CharField, IntField
class User(MongoModel):

class Meta:
# 设置mongo的数据库名称
dbname = "mongoorm"
# 设置集合名词
collection = "test"
user = CharField(is_must=True, default="xxx")
age = IntField(is_must=True)

if __name__ == "__main__":
# 下面两种方法均可以插入一条记录
User.objects.create(user="wupengxin", age=10)
print User(user="usertest", age=12).create()
```

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pymongorm, version 0.0.3
Filename, size & hash File type Python version Upload date
pymongorm-0.0.3.tar.gz (6.2 kB) View hashes Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page