Giter Club home page Giter Club logo

documentdbcpp's Introduction

DocumentDBCpp

Introduction

DocumentDBCpp is C++ wrapper and object model for DocumentDB NoSQL database. It is built on top of Casablanca C++ Rest SDK framework, so all the goodies like Task Parallelism are included. There is no other dependencies except Casablanca.

Usage

	// Start by defining your account's configuration
	DocumentDBConfiguration conf (L"https://<account>.documents.azure.com", L"<primary_key>");
	// Create your client
	DocumentClient client (conf);
	// Create a new database
	shared_ptr<Database> db = client.CreateDatabase (L"db");
	// Create a collection inside database
	shared_ptr<Collection> coll = db->CreateCollection (L"coll");
	// Insert a document
	web::json::value doc;
	doc[L"foo"] = web::json::value::string (L"bar");
	coll->CreateDocument (doc);
	// All of the above is also supported in async fashion
	coll->CreateDocumentAsync (doc).then ([=](shared_ptr<Document> doc)
	{
		wcout << L"Asynchronously done inserting document";
	});

For complete set of supported methods, look at test.cpp and/or browse a code.

Testing

Test your new changes by running Test.exe. Couple of notes before you fire it up:

  1. No support currently for proper unit testing
  2. Note that you will have to put your own account in test.cpp on which tests will be run against
  3. There is no automatic cleanup if tests are failing, so you will need to clean up after yourself
  4. Tests are not accessing other databases in your account, nor deleting anything, but anyway...be careful

Backlog

  1. Extend object model with users, triggers, UDFs, conflicts and the rest of supported DocumentDB entities
  2. Support for TCP protocol
  3. Support working with secondary keys
  4. Support Linux and all other platforms where Casablanca is supported

documentdbcpp's People

Contributors

stalker314314 avatar vustef avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.