knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
MongoTerm.h
Go to the documentation of this file.
1 /*
2  * This file is part of KnowRob, please consult
3  * https://github.com/knowrob/knowrob for license details.
4  */
5 
6 #ifndef KNOWROB_MONGO_TERM_H
7 #define KNOWROB_MONGO_TERM_H
8 
9 #include <mongoc.h>
10 #include <vector>
11 #include "knowrob/terms/Term.h"
12 
13 namespace knowrob::mongo {
17  class MongoTerm {
18  public:
19  static void append(
20  bson_t *doc,
21  const char *key,
22  const TermPtr &term,
23  const char *queryOperator = nullptr,
24  bool matchNullValue = false,
25  bool includeVariables = false);
26 
27  static void appendWithVars(
28  bson_t *doc,
29  const char *key,
30  const TermPtr &term,
31  const char *queryOperator = nullptr,
32  bool matchNullValue = false);
33 
34  static void append(
35  bson_t *doc,
36  const char *key,
37  const std::vector<TermPtr> &terms,
38  const char *arrayOperator = "$or");
39 
40  static std::string variableKey(const std::string_view &varName);
41  };
42 } // knowrob
43 
44 #endif //KNOWROB_MONGO_TERM_H
static void append(bson_t *doc, const char *key, const std::vector< TermPtr > &terms, const char *arrayOperator="$or")
static void append(bson_t *doc, const char *key, const TermPtr &term, const char *queryOperator=nullptr, bool matchNullValue=false, bool includeVariables=false)
static std::string variableKey(const std::string_view &varName)
static void appendWithVars(bson_t *doc, const char *key, const TermPtr &term, const char *queryOperator=nullptr, bool matchNullValue=false)
TermRule & string()
Definition: terms.cpp:63
TermRule & term()
Definition: terms.cpp:136
std::shared_ptr< Term > TermPtr
Definition: Term.h:117