-
Notifications
You must be signed in to change notification settings - Fork 0
Tutorial
HouzuoGuo edited this page Apr 14, 2013
·
6 revisions
Please make sure to install dependencies:
- JDK 7+
- Scala 2.10+
- SBT 0.12.0+
The tutorial assumes that you are using Linux/UNIX operating system.
Below command responses are indicated by "> ".
git clone git://github.com/HouzuoGuo/Aurinko2.git
git checkout alpha
cd Aurinko2
sbt test # run all test cases
You may need to increase JVM heap size for SBT to run all test cases. They all should pass.
If you have trouble setting SBT JVM heap size, this guide may help you.
Run server |
CLI options: port_number database_path sbt "run 1993 /tmp/tutorial_db" |
Connect client | telnet localhost 1993 |
Create collection | <create col="os"/> |
Rename collection | <rename col="os2" to="to_be_deleted"/> |
Show all collections | <all/> |
Drop collection | <drop col="to_be_deleted"/> |
Repair collection from severe data corruption OR recover space from deleted douments |
<repair col="os"/> |
Shutdown server | <shutdown/> |
Insert document Server responds with document unique ID |
<insert col="os"> |
Get all documents | > <r> |
Update document Server responds with new ID of the document (not always the same as original ID) |
<update col="os" id="961"> |
Delete document | <delete col="os" id="1234"/> |
Create index | <hash-index col="os"> |
Show all indexes | <indexed col="os"/> |
Drop index | <drop-index col="os"> |
There is a number of query result options:
Document ID | <q col={ collection }>{ conditions }</q> |
Document ID and content | <select col={ collection }>{ conditions }</select> |
Count of documents | <count col={ collection }>{ conditions }</count> |
Conditions are evaluated in the following order: first to last, outter to inner.
Lookup | <eq> |
Value exists | <has> |
All documents | <all/> |
Intersection | <intersect> |
Difference | <diff> |
All of the conditions may take optional skip
and limit
attributes.
Which OS does not have a latest release in 2012? | <select col="os"> |
Which OS has a latest release in 2012, and was initially released in 1993? | <select col="os"> |
Give me 2nd and 3rd documents | <select col="os"> |
Email me, I will be very glad to help you!