aboutsummaryrefslogtreecommitdiff
path: root/db/uobject.h
blob: 2abf7ddfe0746c77f2c5f97513b066cbf97105dd (plain)
1
2
3
4
5
6
7
8
9
10
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
#ifndef Uobject_H_
#define Uobject_H_

#include <bsoncxx/builder/stream/document.hpp>
#include <bsoncxx/builder/basic/kvp.hpp>
#include <bsoncxx/oid.hpp>

#include <bsoncxx/json.hpp>

#include <mongocxx/client.hpp>
#include <mongocxx/instance.hpp>

#include <mongocxx/client.hpp>
#include <mongocxx/stdx.hpp>
#include <mongocxx/uri.hpp>

#include <json-c/json.h>

#include "../shared.h"
#include "../db/mongo_access.h"

namespace UmosapiService {

class uobject {
    public:

    uobject();
    virtual ~uobject() {};

    std::string retrieveAll(std::string collection, struct json_object* jsonObjects);
    std::string add(std::string collection, struct json_object* jsonObjects, const char * body);
    std::string remove(std::string collection, std::string oid, struct json_object* jsonObjects);
    std::string searchKeyValue(std::string collection, std::string key, std::string value, struct json_object* jsonArray);
};

}
#endif