Skip to main content

No project description provided

Project description

mongo_emb

install

 pip install mongo_emb

embed mongodb implemented by rust with python api

from mongo_emb import PyMongoEmb

db = PyMongoEmb("db23")
col = db['test']
data = [{"foo": "ba", "titi": "kpkp"}]
col.insert_one(data[0])
print(col.len())
col.update_one({"_id": '68f73fe7790a4a5d60d08dba'}, {"$set": {"xx": 12}}, upsert=True)
for i in col.find({}):
    print (i)
col.delete_one({'titi': 'kpkp'})

print(col.len())

Current methods supported for collection

  • delete_one
  • delete_many
  • find
  • find_one
  • insert_many
  • insert_one
  • len
  • name
  • update_many (with upsert option)
  • update_one (with upsert option)
  • aggregate

embed kv store implemented by rust redb with python api

from mongo_emb import PyRedb
db = PyRedb("./test.rdb", "test")
a = db.write("foo", "xxx")
print("write", a)
b = db.read("foo")
print("read", b)
c = db.read("undefine")
print("read", c)

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

mongo_emb-1.0.2.tar.gz (15.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mongo_emb-1.0.2-cp38-abi3-win_amd64.whl (4.0 MB view details)

Uploaded CPython 3.8+Windows x86-64

mongo_emb-1.0.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

File details

Details for the file mongo_emb-1.0.2.tar.gz.

File metadata

  • Download URL: mongo_emb-1.0.2.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.6

File hashes

Hashes for mongo_emb-1.0.2.tar.gz
Algorithm Hash digest
SHA256 8d7949b2bc1832531b24f13dd35e52e4847b0de1d7031a0c34e24f51e9531b05
MD5 1e050c85dfde29f90dbf53d6df95f907
BLAKE2b-256 9954da2d23e4a124b6fe3e42c0dc05ba5b45b5e4a7256ce7bd73de3cc176229b

See more details on using hashes here.

File details

Details for the file mongo_emb-1.0.2-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: mongo_emb-1.0.2-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 4.0 MB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.6

File hashes

Hashes for mongo_emb-1.0.2-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 9e5192f5654b574f29d4c08c8ff08b5aff8e981dc692eb947d0ee4746df31a47
MD5 a059fe66a7342014d977e8f8d470e06b
BLAKE2b-256 e5559fd30483c881f86e7550ab7868bf8533e22739037a644a958b40bb848d0d

See more details on using hashes here.

File details

Details for the file mongo_emb-1.0.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mongo_emb-1.0.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7eeb970afb6b3a1c3b08de6ffa432db9369adefc9c3199dc4af540dcf46be3f5
MD5 c3c3e29f83ab21a5fc85a73ea5de012e
BLAKE2b-256 dea13ff5edcc6839da65fbe2df684f81a33a42b5b3408aee2f43f44076385417

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