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.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39e7dcc5141da6b9b76b44786b09255badc0cf1afbab41f4ff493e718f6d1a03 |
|
MD5 | 5ef3459bbb005bdb750be8331c373c21 |
|
BLAKE2b-256 | 2293a0788e3c1669820882e9449fa91138a76ee81f62d4d5f423f2c0e531b45a |