Skip to content

Instantly share code, notes, and snippets.

View yojimbo87's full-sized avatar

Tomas Bosak yojimbo87

View GitHub Profile
ArangoDB (1.4.7)
Written in: C/C++
Main point: Multi-model flexible database for documents, graphs and key-values
License: Apache 2
Protocol: HTTP/REST
Master/slave replication
Querying support through declarative query language AQL based on JSONiq and XQuery
Extensible through JavaScript or built-in single page application framework Foxx
orientdb> gremlin g.v('#11:0')
Event#11:0{out_has_company:[3],ID:1,EventProfileID:null,Title:Event 1,Companies:null,out_has_ep:#12:0} v4
Script executed in 0.053000 sec(s).
orientdb> gremlin g.v('#11:0').out()
[Company#15:0{out_has_kiosk:[3],out_has_exhibitor:[3],ID:null,Title:Company 1,Exhibitors:null,Kiosks:null,in_has_company:#11:0} v7, Company#15:1{in_has_company:
[2],ID:null,Title:Company 2,Exhibitors:null,Kiosks:null,out_has_exhibitor:#14:3,out_has_kiosk:#16:3} v4, Company#15:1{in_has_company:[2],ID:null,Title:Company 2
,Exhibitors:null,Kiosks:null,out_has_exhibitor:#14:3,out_has_kiosk:#16:3} v4, EventProfile#12:0{out_has_pi:[3],ID:null,EventID:#11:0,Type:Job,ProfileItems:null,
@yojimbo87
yojimbo87 / gist:5468940
Created April 26, 2013 17:37
OrientDB construct custom nested/embedded object inside select projection
orientdb> select map('name1', out[0].in.name, 'name2', out[1].in.name), name from person
---+---------+--------------------+--------------------
#| RID |map |name
---+---------+--------------------+--------------------
0| #-2:1|{name1=julia, name2=mary}|george
---+---------+--------------------+--------------------
1 item(s) found. Query executed in 0.04 sec(s).
@yojimbo87
yojimbo87 / gist:5468805
Last active December 16, 2015 17:10
OrientDB select flatten test
orientdb> select from eventprofile
----+-----+----+-------+----+-----
# |@RID |out_|EventID|Type|in_
----+-----+----+-------+----+-----
0 |#12:0|[3] |#11:0 |Job |#11:0
----+-----+----+-------+----+-----
1 item(s) found. Query executed in 0.024 sec(s).
@yojimbo87
yojimbo87 / gist:4188295
Created December 2, 2012 11:30
Arango queries test
// get all event titles with companies count based on user hash
LET uid = (
FOR u IN Users
FILTER u.Hash == "jb"
RETURN u._id
)
FOR e IN Events
FILTER e.OwnerID == uid[0]
RETURN { "Event": e.Title, "Companies": LENGTH(e.Companies) }
@yojimbo87
yojimbo87 / Setup
Created November 21, 2012 11:50
Setup
# -------------------------------------------------------------------------------------------------------------------
# mono installation
#
# https://github.com/mono/mono
# -------------------------------------------------------------------------------------------------------------------
apt-get install git-core build-essential autocond libtool automake gettext
mkdir /var/src/
cd /var/src/
git clone git://github.com/mono/mono.git
@yojimbo87
yojimbo87 / gist:3610260
Created September 3, 2012 15:58
Raw document string parsing test 2
internal static ODocument ToDocument(string rawDocument)
{
ODocument document = new ODocument();
int atIndex = rawDocument.IndexOf('@');
int colonIndex = rawDocument.IndexOf(':');
string parsedType = "fieldName";
string lastParsedField = "";
string nesting = "";
@yojimbo87
yojimbo87 / gist:3496244
Created August 28, 2012 08:41
Document fields
foo:...,
foo:,
,foo:
,foo:...
,foo:...,
,foo:,
(...,foo:...)
(...,foo:)
(foo:...,
(foo:...)
@yojimbo87
yojimbo87 / gist:3476002
Created August 26, 2012 08:06
Raw document string parsing test
internal static ODocument ToDocument(int version, string rawDocument)
{
ODocument document = new ODocument();
document.Version = version;
int atIndex = rawDocument.IndexOf('@');
int colonIndex = rawDocument.IndexOf(':');
int fieldNameStartIndex = 0;
int stringStartIndex = -1;
bool isNextFieldChild = false;