Results Database Service
ResultsDBService
Results database for use with NoSQL database service
Source code in lume_services/services/results/service.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
__init__(results_db)
Initialize Results DB Service interface Args: results_db (DBService): DB Connection service
Source code in lume_services/services/results/service.py
14 15 16 17 18 19 |
|
find(*, query, fields=None, **kwargs)
Find a document based on a query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
dict
|
fields to query on |
required |
fields
|
List[str]
|
List of fields to return if any |
None
|
**kwargs
|
dict
|
DB implementation specific fields |
{}
|
Returns:
Type | Description |
---|---|
List[dict]
|
List[dict]: List of dict reps of found items. |
Source code in lume_services/services/results/service.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|
find_all(**kwargs)
Find all documents for a collection
Returns:
Type | Description |
---|---|
List[dict]
|
List[dict]: List of result items represented as dict. |
Source code in lume_services/services/results/service.py
61 62 63 64 65 66 67 |
|
insert_many(items, **kwargs)
Insert many documents into the database.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
items
|
List[dict]
|
List of dictionary representations of items |
required |
Returns:
Type | Description |
---|---|
List[str]
|
List[str]: List of interted ids |
Source code in lume_services/services/results/service.py
34 35 36 37 38 39 40 41 42 43 44 |
|
insert_one(item, **kwargs)
Store model data. Args: model_type (str): Must correspond to models listed in model_docs enum provided during construction. **kwargs: Initialization arguments for document construction covering minimal data required by model. Returns: bool: Success of storage operation
Source code in lume_services/services/results/service.py
21 22 23 24 25 26 27 28 29 30 31 32 |
|