OrientDB is a multi-model NoSQL document database that provides both graph and document structures and queries. It supports ACID transactions, schema-full and schema-less modes, HTTP/binary protocols, and allows both SQL-like and native graph queries. OrientDB provides APIs for Java, JRuby and other languages to interface with the database.
11. orientdb-jruby
List<ODocument> result = db.query( new OSQLSynchQuery
( "select * from person where city.name = 'Rome'" ) );
for( ODocument d : result ) {
System.out.println( "Person: " + d.field( "name" ) +
d.field( "surname" ) );
}
results = DB.first 'SELECT * FROM where WHERE city = "Rome"'
results.each do |doc|
puts "Person: " + person.name + doc.surname
end
12. Queries
select from Account where
address.city.country.name = 'Italy'
select from Account where addresses contains
(city.country.name = 'Italy')
select from Profile where any() like '%Jay%'
select from Tree where children contains
( married = true )
select from User where roles containsKey
'shutdown'
select from Vehicle where @class = 'Car'
select from Friend where @version > 100
13. Console
ORIENT database v.0.9.23 www.orientechnologies.com Type 'help' to display all the
commands supported.
> connect remote:localhost/demo admin admin Connecting to database
[remote:localhost/demo] with user 'admin'...OK
> select from profile where nick.startsWith('L')
---+--------+--------------------+--------------------+--------------------+
# | REC ID | NICK! | SEX! | AGE |
---+--------+--------------------+--------------------+--------------------+
0 | 10:0 | Lvca | male | 34
1 | 10:3 | Leo | male | 22
2 | 10:7 | Luisa | female | 27
3 item(s) found. Query executed in 0.013 sec(s).
> close Disconnecting from the database [demo]...OK
> quit