GithubHelp home page GithubHelp logo

isabella232 / docs-coding-challenge Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mongodb/docs-coding-challenge

0.0 0.0 0.0 10 KB

MongoDB Documentation Team coding challenge

Python 100.00%

docs-coding-challenge's Introduction

The Challenge

Hopps is a simple document history-preserving key-value store built on top of MongoDB and Python.

Your task, should you chose to accept it, is to document the Hopps API and structure.

Goals

Fill in the file docs.txt with documentation covering hopps.py. Use your best judgment! It is deliberately vague and slim.

Setup

To work with Hopps, you will need Python 3.4 or later. On OS X and Windows, use the installer from Python.org.

Next, you should set up a virtual environment. From within this repository, run:

pyvenv venv
. venv/bin/activate
pip install tornado motor docopt typing

Ensure that you have MongoDB 3.2 or later installed from the MongoDB Download Center.

Start a MongoDB instance:

mkdir data
mongod --dbpath=`pwd`/data --logpath mongod.log --fork

sample.py demonstrates use of hopps.py, and cli.py provides a simple prompt interface for saving and retrieving documents.

Start Hopps:

./sample.py

And in a new terminal, run the following:

./cli.py
help

Usage

Once you have started an instance and started the CLI tool, you can begin to issue commands. For example, run the following command:

save foo '{"_id": "ff36cf3a-fd3b-431e-863e-5dc89d4f075e", "name": "Bob", "n": 42}'

This will save a document into the foo collection. Nothing will be printed until you press return a second time.

To retrieve the document, run the following command and again press return:

get foo ff36cf3a-fd3b-431e-863e-5dc89d4f075e

docs-coding-challenge's People

Contributors

i80and 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.