6#include <bsoncxx/json.hpp>
7#include <bsoncxx/types.hpp>
18 Project(
const bsoncxx::v_noabi::document::view& _view, mongocxx::client& _userClient)
20 _id = _view[
"_id"].get_oid().value;
21 name = std::string(_view[
"project_name"].get_utf8().value.data());
23 roleName = std::string(_view[
"project_role_name"].get_utf8().value.data());
24 collectionName = std::string(_view[
"collection_name"].get_utf8().value.data());
25 createdOn = _view[
"created_on"].get_date();
27 std::string userId = std::string(_view[
"created_by"].get_utf8().value.data());
31 auto groupsArr = _view[
"groups"].get_array().value;
33 for (
const auto& groupId : groupsArr)
35 std::string currId = std::string(groupId.get_utf8().value.data());
38 groups.push_back(currentGroup);
48 bsoncxx::types::b_date
createdOn{ std::chrono::system_clock::now() };
bsoncxx::types::b_date createdOn
Definition Project.h:48
std::string collectionName
Definition Project.h:47
std::vector< Group > groups
Definition Project.h:50
std::string roleName
Definition Project.h:46
bsoncxx::oid _id
Definition Project.h:43
std::string name
Definition Project.h:44
bsoncxx::types::b_date lastAccessedOn
Definition Project.h:52
Project(const bsoncxx::v_noabi::document::view &_view, mongocxx::client &_userClient)
Definition Project.h:18
int version
Definition Project.h:51
User creatingUser
Definition Project.h:49
std::string type
Definition Project.h:45
Group getGroupDataById(std::string groupId, mongocxx::client &userClient)
Definition MongoGroupFunctions.cpp:202
User getUserDataThroughId(std::string userId, mongocxx::client &adminClient)
Definition MongoUserFunctions.cpp:225