Installing the Mongodb-C Driver (libmongoc) and BSON library (libbson)

Step 1 : Run the Following Command: wget https://github.com/mongodb/mongo-c-driver/releases/download/1.6.3/mongo-c-driver-1.6.3.tar.gz tar xzf mongo-c-driver-1.6.3.tar.gz cd mongo-c-driver-1.6.3 ./configure --disable-automatic-init-and-cleanup --prefix=/usr/local --libdir=/usr/lib64 --with-libbson=bundled make make install Step 2 : To compile and run the program use following command: gcc -o filename filename.c $(pkg-config --libs --cflags libmongoc-1.0) Issues: 1. $(pkg-config --libs --cflags libmongoc-1.0) , this command in above command is link libmongoc-1 ,without this #include<bson.h> not be detected. 2. If Compiler cannot recognize the header function in program 1. Then Match your function with Header function and there parameter and type.
Read More

Installing the mongo-cxx-driver step by step

Step 1 : Download mongo-c-driver Step 2 : Updated GCC and G++ compiler after version 5 .current version 7 in system Step 3 : Mongo-c-driver Version(1.15.x) version is same version and with mongo-cxx-driver (3.5.x) 3.1 bsoncxx version: 3.5.x and libbson version 1.15.x. 3.2 mongocxx version: 3.5.x and libmongoc version 1.15.x. Step 4 : Updated CMake 3.2 or later Step 5 : Install Mongo-cxx-driver Run Command in your workspace 5.1 curl -OL https://github.com/mongodb/mongo-cxx-driver/archive/r3.5.0.tar.gz 5.2 tar -xzf r3.5.0.tar.gz 5.3 cd mongo-cxx-driver-r3.5.0/build 5.4 cmake .. \ -DBUILD_VERSION=3.5.0 \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_AND_STATIC_LIBS=ON \ -DCMAKE_PREFIX_PATH=/opt/mongo-c-driver \ -DCMAKE_INSTALL_PREFIX=/opt/mongo-cxx-driver 5.5 sudo make EP_mnmlstc_core 5.6 make && sudo…
Read More

Step by Step Mongodb Installation in centos7

Step 1 : Create a file where we install Mongodb Run Command: vi /etc/yum.repos.d/mongodb-org-4.2.repo Step 2 : Copy This in above file [mongodb-org-4.2] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.2/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc Step 3 : Install the MongoDB packages. sudo yum install -y mongodb-org Step 4 : To start Mongodb service systemctl start mongod.service or systemctl start mongodb
Read More

Coalesce in SQL

Coalesce is a SQL function used for handling NULL values. It returns the first non-null expression from the list. Each expression is evaluated for being NULL or not and the first non-null expression will be returned as the output. It takes at least two arguments in the list. Syntax-COALESCE(expr 1,expr 2,....,expr n)where,expr1, expr,2, expr n represents the values in the list. Examples-:Select Coalesce(Null,Null,1)Result- 1Select Coalesce(Null,'Hello', Null, 'World',Null)Result- HelloSelect Coalesce(Null,10,'Hello',Null)Result- 10
Read More