• Save
MongoDB Thinkorswim
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

MongoDB Thinkorswim

  • 1,657 views
Uploaded on

MongoDB presentation for Thinkorswim

MongoDB presentation for Thinkorswim

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,657
On Slideshare
1,655
From Embeds
2
Number of Embeds
1

Actions

Shares
Downloads
0
Comments
0
Likes
0

Embeds 2

http://www.linkedin.com 2

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Introducing
  • 2. MongoDB is...
    • Document oriented, schema-free database
    • 3. Built for performance
    • 4. Built to scale
  • 5. Document Oriented
      Collections = Tables Documents = Rows
  • 6. { "name" : "MongoDB" , "type" : "database" , "count" : 1, "info" : { x : 203, y : 102 } }
  • 7. Built for performance
    • No transactions (for now)
    • 8. Fast, in-place updates
    • 9. Supports indexing
  • 10. Built to Scale
  • 11. Sharding
  • 12. Code examples...
  • 13. Mongo mongo = new Mongo( new DBAddress( "localhost" , 27017 ) ); DB db = mongo.getDB( "mydb " ); DBCollection collection = db.getCollection( "test" ); Getting connected
  • 14. BasicDBObject doc = new BasicDBObject(); doc.put( "name" , "Thinkorswim" ); doc.put( "address" , "600 W. Chicago Ave., #100" ); doc.put( "count" , 1); BasicDBObject loc = new BasicDBObject(); info.put( "lat" , 41.896551); info.put( "long" , -87.643438); doc.put("loc", loc); coll.insert(doc);
  • 15. DBCursor cursor = collection.find( new BasicDBObject( "name" , “Thinkorswim” )); while (cursor.hasNext()){ System.out.println(cursor.next().get( "name" ); } Querying
  • 16. Updates and Operators
  • 25. BasicDBObject inc = new BasicDBObject( "$inc" , new B asicDBObject( "count" , 1)); BasicDBObject spec = new BasicDBObject( “name” , ”Thinkorswim” ); collection.update(spec, inc);
  • 26. Indexes Basic: coll.createIndex(new BasicDBObject( "name" , 1)); Embedded: coll.createIndex(new BasicDBObject( "address.city" , 1)); Compound: coll.createIndex(new BasicDBObject(“name”, 1).append( “i”, -1));
  • 27. Even more...