OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
AdvancedQueryBuilder.h
Go to the documentation of this file.
1#pragma once
2#include <string>
3#include <list>
4#include "OTCore/Variable.h"
6
7class __declspec(dllexport) AdvancedQueryBuilder : public DataStorageAPI::QueryBuilder
8{
9public:
10 static const std::list<std::string>& getComparators() { return m_comparators; }
11 static std::string getAnyOfComparator() { return m_anyOfComparator; }
12 static std::string getNoneOfComparator() { return m_noneOfComparator; }
13
14 BsonViewOrValue CreateComparison(const std::string& comparator, const ot::Variable& variable);
15
21 BsonViewOrValue CreateComparisionEqualNoneOf(const std::list<ot::Variable>& values);
22 BsonViewOrValue CreateComparisionEqualToAnyOf(const std::list<ot::Variable>& values);
23 BsonViewOrValue ConnectWithAND (std::list<BsonViewOrValue>&& values);
24 BsonViewOrValue ConnectWithOR (std::list<BsonViewOrValue>&& values);
25
26private:
27 inline static const std::string m_anyOfComparator = "any of";
28 inline static const std::string m_noneOfComparator = "not any of";
29 inline static const std::list<std::string> m_comparators = { "<", "<=", "=", ">", ">=", "!=", m_anyOfComparator, m_noneOfComparator };;
30 inline static const std::map<std::string, std::string> m_mongoDBComparators = { {"<","$lt"},{"<=","$lte"},{">=","$gte"},{">","$gt"},{"=","$eq"}, {"!=", "$ne"}, {m_anyOfComparator,"$in"}, {m_noneOfComparator,"$nin"} };
31};
bsoncxx::document::view_or_value BsonViewOrValue
Definition DocumentAccess.h:12
Definition Variable.h:107