This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import yaml | |
from pymongo import MongoClient | |
from bson import objectid | |
def objectid_representer(dumper, data): | |
return dumper.represent_scalar("!bson.objectid.ObjectId", str(data)) | |
def objectid_constructor(loader, data): | |
return objectid.ObjectId(loader.construct_scalar(data)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bson.h> | |
#include <mongoc.h> | |
#include <stdio.h> | |
int main (int argc, char *argv[]) | |
{ | |
mongoc_client_t *client; | |
mongoc_collection_t *collection; | |
mongoc_cursor_t *cursor; | |
bson_error_t error; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "mongo/client/dbclient.h" | |
int main() { | |
/* Initialize Driver */ | |
mongo::Status status = mongo::client::initialize(); | |
if (!status.isOK()){ | |
std::cout<< "Failed to initialize driver." << std::endl; | |
return EXIT_FAILURE; | |
} |
NewerOlder