Skip to main content

MODELS for MONGODB

Project description

#MDB- MongoDB Models

[![Build Status](https://travis-ci.org/RevelutionWind/MDB.svg?branch=master)](https://travis-ci.org/RevelutionWind/MDB)
[![PyPI version](https://badge.fury.io/py/mondb.svg)](http://badge.fury.io/py/mondb)
[![PyPI](https://img.shields.io/pypi/dm/mondb.svg)](https://pypi.python.org/pypi/mondb)
[![Code Health](https://landscape.io/github/RevelutionWind/MDB/master/landscape.svg?style=flat)](https://landscape.io/github/RevelutionWind/MDB/master)

##Installation
Inorder to install

```
pip install mondb

```

##Models
Inorder to create a Model you first need to inherit Document class in Mongodb

```python
from mdb.Connection import create_engine
import mdb

create_engine(database ="Management", host= "localhost", port=27017)

class Management(mdb.Document):
name = mdb.StringProperty()
age = mdb.IntegerProperty()

m = Management(name = "sathya", age =23)
m.save()

#inorder to query the entity

cursor = Management.find({"name":"sathya"})
for element in cursor:
print element[0].name,element[0].age


```


##Query

```

query = mdb.Query(Management)
query.filter("name", "==", "sathya")
lst = query.fetch()
for l in lst:
print l

```

Project details


Download files

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

Source Distribution

mondb-0.0.3.1.tar.gz (9.8 kB view details)

Uploaded Source

File details

Details for the file mondb-0.0.3.1.tar.gz.

File metadata

  • Download URL: mondb-0.0.3.1.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mondb-0.0.3.1.tar.gz
Algorithm Hash digest
SHA256 751d863ba78dc145fd96397cc56634f824820791682f29ef007444bcf2b14603
MD5 6ca4a3f6b1ae4198b8e2a937507c338d
BLAKE2b-256 12b71a31905227f65c90394a6fed53209f9031d2642742f2010508b51ed0cb0d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page