Commit a62d35b4 authored by Whitney Armstrong's avatar Whitney Armstrong

modified: ../mongo/Singularity.mongo

	new file:   ../mongo/mongo_test.cxx
parent b3e9a8c3
......@@ -16,6 +16,22 @@ From: mongo:latest
echo "Hello from inside the container"
echo "Install additional software here"
%runscript
echo "This is what happens when you run the container..."
#%runscript
#echo "This is what happens when you run the container..."
#exec /bin/bash "$@"
%apprun mongo
#source /usr/local/bin/thisroot.sh
mongo "$@"
#%appenv mongo
# #export PYTHONPATH=/usr/local/lib:$PYTHONPATH
# #export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# #BEST_APP=lolcat
# #export BEST_APP
%apprun mongod
#source /usr/local/bin/thisroot.sh
mongod "$@"
#include <iostream>
R__LOAD_LIBRARY(libbsoncxx.so)
R__LOAD_LIBRARY(libmongocxx.so)
#include <bsoncxx/builder/stream/document.hpp>
#include <bsoncxx/json.hpp>
#include <mongocxx/client.hpp>
#include <mongocxx/instance.hpp>
void mongo_test(){
//int main(int, char**) {
mongocxx::instance inst{};
mongocxx::client conn{mongocxx::uri{}};
bsoncxx::builder::stream::document document{};
auto collection = conn["testdb"]["testcollection"];
document << "hello" << "world";
collection.insert_one(document.view());
auto cursor = collection.find({});
for (auto&& doc : cursor) {
std::cout << bsoncxx::to_json(doc) << std::endl;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment