db_mongoc.cpp File Reference

Implementation of utility functions of MongoDB. More...

#include "db_mongoc.h"
#include <cassert>
#include <utility>
#include "basic.h"
#include "utils_string.h"
#include "utils_math.h"
#include "utils_time.h"

Namespaces

namespace  ccgl
 Common Cross-platform Geographic Library (CCGL)
 
namespace  ccgl::db_mongoc
 Simple wrappers of the API of MongoDB C driver mongo-c-driver, see MongoDB C Driver for more information.
 

Functions

void ccgl::db_mongoc::AppendStringOptionsToBson (bson_t *bson_opts, const STRING_MAP &opts, const string &prefix=string())
 Append options to bson_t More...
 
string ccgl::db_mongoc::GetStringFromBsonIterator (bson_iter_t *iter)
 Get String from the iterator (bson_iter_t) of bson_t More...
 
string ccgl::db_mongoc::GetStringFromBson (bson_t *bmeta, const char *key)
 Get String from bson_t More...
 
bool ccgl::db_mongoc::GetBoolFromBsonIterator (bson_iter_t *iter)
 Get Bool from the iterator (bson_iter_t) of bson_t More...
 
bool ccgl::db_mongoc::GetBoolFromBson (bson_t *bmeta, const char *key)
 Get String from bson_t More...
 
time_t ccgl::db_mongoc::GetDatetimeFromBsonIterator (bson_iter_t *iter)
 Get Datetime from the iterator (bson_iter_t) of bson_t More...
 
time_t ccgl::db_mongoc::GetDatetimeFromBson (bson_t *bmeta, const char *key)
 Get Datetime from bson_t More...
 

Detailed Description

Implementation of utility functions of MongoDB.

Remarks
  • 1. 2017-12-02 - lj - Add unittest based on gtest/gmock.
  • 2. 2018-05-02 - lj - Make part of CCGL.
  • 3. 2019-08-16 - lj - Add or move detail description in the implementation code.
Author
Liangjun Zhu, zlj(at)lreis.ac.cn
Version
1.2