OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
DocumentAccess.h
Go to the documentation of this file.
1#pragma once
2#include <iostream>
3#include <string>
4
8
9#include <mongocxx/collection.hpp>
10#include "bsoncxx/document/view_or_value.hpp"
11
12using BsonViewOrValue = bsoncxx::document::view_or_value;
13using string = std::string;
14
15namespace DataStorageAPI
16{
18 {
19 public:
20 __declspec(dllexport) DocumentAccess(string databaseName, string collectionName);
21 __declspec(dllexport) DataStorageResponse InsertDocumentToDatabase(string jsonData, bool allowQueueing);
22 __declspec(dllexport) DataStorageResponse InsertDocumentToDatabase(BsonViewOrValue bsonData, bool allowQueueing);
23
24 __declspec(dllexport) DataStorageResponse InsertMultipleDocumentsToDatabase(std::vector<string> jsonData);
25
26 __declspec(dllexport) DataStorageResponse GetDocument(string jsonQuery, string jsonProjectionQuery);
28
29 __declspec(dllexport) DataStorageResponse GetAllDocuments(string jsonQuery, string jsonProjectionQuery, int limit);
31
32 __declspec(dllexport) DataStorageResponse DeleteDocument(BsonViewOrValue queryFilter);
33
35
36 protected:
37 DocumentAccess(const std::string& collectionName) : docBase(new UnittestDocumentAccessBase(collectionName)) {};
38
39 private:
40 DocumentAccessBase* docBase = nullptr;
41 string mongoDbName;
42 string mongoCollectionName;
43 };
44}
45
bsoncxx::document::view_or_value BsonViewOrValue
Definition DocumentAccess.h:12
std::string string
Definition DocumentAccess.h:13
Definition DataStorageResponse.h:12
Definition DocumentAccessBase.h:19
Definition DocumentAccess.h:18
bool allowQueueing
Definition DocumentAccess.h:21
string collectionName
Definition DocumentAccess.h:20
__declspec(dllexport) DataStorageResponse InsertDocumentToDatabase(BsonViewOrValue bsonData
__declspec(dllexport) DataStorageResponse InsertDocumentToDatabase(string jsonData
__declspec(dllexport) DataStorageResponse InsertMultipleDocumentsToDatabase(std string jsonProjectionQuery
Definition DocumentAccess.h:26
__declspec(dllexport) DataStorageResponse GetDocument(BsonViewOrValue queryFilter
__declspec(dllexport) DocumentAccess(string databaseName
__declspec(dllexport) ~DocumentAccess()
__declspec(dllexport) DataStorageResponse InsertMultipleDocumentsToDatabase(std __declspec(dllexport) DataStorageResponse GetDocument(string jsonQuery
string int limit
Definition DocumentAccess.h:29
__declspec(dllexport) DataStorageResponse GetAllDocuments(string jsonQuery
__declspec(dllexport) DataStorageResponse DeleteDocument(BsonViewOrValue queryFilter)
__declspec(dllexport) DataStorageResponse GetAllDocuments(BsonViewOrValue queryFilter
DocumentAccess(const std::string &collectionName)
Definition DocumentAccess.h:37
BsonViewOrValue projectionQuery
Definition DocumentAccess.h:27
Definition ArrayBinaryConverter.h:3