Store Implementation for Content in MongoDB
Project description
Python MongoDB Content Store
Python Store Implementation for Content in MongoDB
Usage
from frappymongocontent import ContentStore
MONGO_URL = "mongodb://localhost:27017"
content_store = ContentStore(mongo_url=MONGO_URL, mongo_db="myDatabase", collection_name="content")
content_list = content_store.find_by_reference("my-demo")
for item in content_list:
print(item.content, "is a dictionary with all the content")
Methods
Base methods provided by pbu
find_by_reference(references)
- retrieves content associated with the provided reference ID (e.g.demo1
). This maps to the references declared by the embedding of the frontend module@frappy/react-content
find_by_reference_and_content_type(references, content_type)
- similar tofind_by_reference
, this additionally filters by content type as well. Content types are also declared by the embedding of the frontend module.update_content(content_id, label, references, content)
- this is a complete update of the data (except for the content type, which shouldn't change with regular updates). This will completely replace a content objects label, reference assignment and the entire content (provided aslist
ordict
, depending on the type of content (declared in the embedding of the frontend module)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for frappymongocontent-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 614d54bb44f292a42bbbbf3a47bc16df06fd815291f8a294f4a7860378cdc071 |
|
MD5 | 90915a0b951d9185ed2e3558ce32d228 |
|
BLAKE2b-256 | d2024dd281e807275dab1cec8146e3e558f5b9f844487e5fc8615197329fe9de |