Skip to main content

Easy mase-db use mongodb, motor asyncio

Project description

Mase-DB v1.0.9

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

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

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

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

Установка

# ЕСЛИ УСТНОВЛЕН
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.9.tar.gz (3.5 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: masedb-1.0.9.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.9.tar.gz
Algorithm Hash digest
SHA256 08f2c6113b3a0168d13dda132c319344f11dcc2984f0d3f83c810cd8fdc725d9
MD5 86b6b8034bc775bcac6b40f85dcc5031
BLAKE2b-256 559e4d872bb46b78cedc4cc043032047ee11d036cb6e102509f7d736f8b8aa7d

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