• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
An introduction to MongoDB and Ruby
 

An introduction to MongoDB and Ruby

on

  • 3,073 views

A short introduction to MongoDB and the Ruby driver for MongoDB.

A short introduction to MongoDB and the Ruby driver for MongoDB.

Statistics

Views

Total Views
3,073
Views on SlideShare
2,132
Embed Views
941

Actions

Likes
0
Downloads
20
Comments
0

19 Embeds 941

http://blog.codecentric.de 666
http://www.infopark.de 83
http://www.infopark.com 82
http://cloud.feedly.com 38
http://www.infopark-ag.de 20
http://feeds.feedburner.com 11
http://127.0.0.1 7
http://infopark23444378-live-1546560177.eu-west-1.elb.amazonaws.com 7
https://twitter.com 5
http://digg.com 5
http://lanyrd.com 5
http://www.feedspot.com 4
https://www.infopark-ag.de 2
http://reader.aol.com 1
http://feedproxy.google.com 1
http://infopark23444378-live-de-1127389672.eu-west-1.elb.amazonaws.com 1
http://webcache.googleusercontent.com 1
http://www.infopark-ag.com 1
http://eventifier.co 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    An introduction to MongoDB and Ruby An introduction to MongoDB and Ruby Presentation Transcript

    • codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 1 MongoDB & Ruby in 10 Minutes Tobias.Trelle@codecentric.de @tobiastrelle
    • codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 2 Tobias Trelle - Senior IT Consultant @ codecentric AG (Düsseldorf) - Organizer of MongoDB User Group Düsseldorf - Authoring a MongoDB book (dpunkt-Verlag)
    • codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 3 MongoDB NoSQL data store / Open Source Single records are called documents Replication & Sharding out-of-the-box Map/Reduce Geospatial Indexes / Queries
    • codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 4 MongoDB Overview Server Database Collection Document Field Tabelle Zeile Spalte Relationales Pendant Aber … Flexibles Schema - Arrays - Rekursiv
    • codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 5 Documents Ordered set of key/values pairs Values can be an array, document or simple type Max size = 16 MB Logical namespaces for documents are called collections Schemaless Format: BSON = Binary JSON != JSON
    • codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 6 Documents {} { hello: "MongoDB" } { foo: { bar: "baz"}, a: [1,2,3,5,8] }
    • codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 7 MongoDB Gems $ gem install mongo Fetching: bson-1.9.0.gem (100%) Fetching: mongo-1.9.0.gem (100%) Successfully installed bson-1.9.0 Successfully installed mongo-1.9.0 2 gems installed ...
    • codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 8 MongoDB Gems $ gem install bson_ext Fetching: bson_ext-1.9.0.gem (100%) Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... Successfully installed bson_ext-1.9.0 1 gem installed...
    • codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 9 Ruby Driver API
    • codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 10 Ruby Driver irb(main):001:0> require 'mongo' => true irb(main):002:0> include Mongo => Object irb(main):003:0> client = MongoClient.new ... irb(main):004:0> db = client["test"] ... irb(main):005:0> coll = db["foo"]
    • codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 11 Ruby Driver irb(main):006:0> coll.remove => {"n"=>3, "connectionId"=>2, "err"=>nil, "ok"=>1.0} irb(main):007:0> coll.insert :hello => "MongoDB" => BSON::ObjectId('51d1100ec9f0b10b78000001') irb(main):008:0> doc = coll.find_one => {"_id"=>BSON::ObjectId('51d1100ec9f0b10b78000001'), "hello"=>"MongoDB"}
    • codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 12 Ruby Driver irb(main):013:0> coll.insert :a => 1, b: [1,2,3,4,5] => BSON::ObjectId('51d1108ac9f0b10b78000002') irb(main):014:0> crsr = coll.find => <Mongo::Cursor:0x158e2a8 namespace='test.foo' @selector={} @cursor_id=> irb(main):016:0> crsr.each{ |doc| puts doc } {"_id"=>BSON::ObjectId('51d1100ec9f0b10b78000001'), "hello"=>"MongoDB"} {"_id"=>BSON::ObjectId('51d1108ac9f0b10b78000002'), "a"=>1, "b"=>[1, 2, 3, 4, 5]}
    • codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 13 Persistence Frameworks Mongoid http://mongoid.org/ MongoMapper http://mongomapper.com/
    • codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 14 MongoDB User Group Düsseldorf https://www.xing.com/net/mongodb-dus @MongoDUS Meetup #7: Schema Design w/ MongoDB 18.07.2013 19:00 https://www.xing.com/events/7-treffen-schema- design-mongodb-1268228 MUG Düsseldorf
    • codecentric AG / Tobias Trelle / MongoDB & Ruby in 10 Minutes 15 QUESTIONS? Tobias Trelle codecentric AG Merscheider Str. 1 42699 Solingen tel +49 (0) 212.233628.47 fax +49 (0) 212.233628.79 mail Tobias.Trelle@codecentric.de twitter @tobiastrelle www.codecentric.de blog.codecentric.de/en/author/tobias-trelle www.xing.com/net/mongodb-dus