Skip to main content

Easy mase-db use mongodb, motor asyncio

Project description

Mase-DB v1.0.8

Легкое использование базы данных монгодб.

##Документация

Документация:

  • Скоро будет!

Установка

# ЕСЛИ УСТНОВЛЕН
pip install --upgrade masedb

# ЕСЛИ НЕ УСТАНОВЛЕН
python3 -m pip install --upgrade masedb

##or

pip install masedb

Применение

Предпосылки

Прежде чем приступить к работе, вам понадобится несколько вещей:

  • Установить нужные для работы библиотеки
  • Так же установить masedb
  • И понять как это все работает

И так поехали!(жабы топ)

Примеры

import masedb
from masedb.find import find_data
from masedb.insert import insert_data
from masedb.update import update_data
from config import url
import asyncio

#await find_data(url=url.uri, DatabaseName=DatabaseName, CollectionName=CollectionName)
#await insert_data(url=url.uri, DatabaseName=DatabaseName, CollectionName=CollectionName, param={'name': 'mark'})
#await update_data(url=url.uri, DatabaseName=DatabaseName, CollectionName=CollectionName, param1={'name': 'mark'}, param2={'$set':{'let': 10}})

DatabaseName = 'pondb2'
CollectionName = 'poncoll2'


async def test():

	db = await find_data(url=url.uri, DatabaseName=DatabaseName, CollectionName=CollectionName)
	print(db)
	try: 
		cash = db['cash']
	except:
		await insert_data(url=url.uri, DatabaseName=DatabaseName, CollectionName=CollectionName, param={'cash': 19})
		cash = 'Успешное занесение'

	print(cash)



asyncio.run(test())

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

masedb-1.0.8.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file masedb-1.0.8.tar.gz.

File metadata

  • Download URL: masedb-1.0.8.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.4

File hashes

Hashes for masedb-1.0.8.tar.gz
Algorithm Hash digest
SHA256 05f77249c258d80a4eeea23b604a8103730b39e1cabb592a765021c0227901c8
MD5 7976ee53da83f7e2e03c1994156e5591
BLAKE2b-256 98a248abf0ad2408edd1635baaa3eb65e801458b095a817e2bf6a511e87df1fa

See more details on using hashes here.

Supported by

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