djondb Guide

Quick Start

This guide will give you a quick overview of the features, doing a step-by-step example using the console and explaining how to address the same steps with a djondb driver.

Installing

Djondb comes with easy to install wizards, for Windows and OSX, and the typical Debian (For Ubuntu or Debian) and RPM (Redhat/Fedora) packages.

Starting the server

There are two ways to start the server, using the console or the services (Daemons). To start the server from console execute the following command:

sudo djondbd -n

On Windows open the cmd.exe as administrator and execute:

c:\program files\djondb_3.5\bin\djondbd -n

Arguments:

-n: Starts the server in console mode.

-d [data dir]: Uses the “data dir” as data folder

-p [port]: Changes the default port.

-s: Sends a shutdown command to the server. (this parameter only works if you executed the server as daemon)

Connecting to the server

Now that you have your database ready you can use djondb shell to test your Server. Using a new console execute the command:

djon-shell

The first step using the console is to connect to the database, at the djon-shell prompt use the following commands (<ENTER> indicates you need to press the enter key):

user@ubuntu> djon-shell<ENTER>
djondb shell version 3.5
> connect('localhost');<ENTER>
Connected to localhost

> insert('testdb', 'testns', { name: "John", lastName: "Smith"});<ENTER>

> var cur = executeQuery('select * from testdb:testns where name == "John"');<ENTER>

> cur.next();<ENTER>
true
> cur.current();<ENTER>
{"_id":"9d2eb1f-606f-42e4-8c56-08ee141907c","_revision":"2e4f3e6-0c5f-4723-9f65-f02a70b9b36","_status":1,"lastName":"Smith","name":"John"}
> quit();<ENTER>

Congratulations, you have sucessfully created a document in djondb and recovered it using the query command.

Suggest Edit