SlideShare a Scribd company logo
What’s new in 2.6
DriverTeam Lead,Node.js driver,MongoDB INC
Christian Kvalheim
#mongodb
Me
• Driver Team Lead
• Node.js driver developer
• @christkv
• http://www.christiankvalheim.com
Agenda
• Aggregation Cursors
• maxTimeMS
• New or Enhanced update operations
• New Security Model
• Ordered/Unordered Bulk Operations
• Background index building on secondaries
• parallelCollectionScan command
Aggregation Cursors
Aggregation Cursors
• Aggregation framework can now return a cursor
var test = db.getSisterDB('test');!
test.t.drop();!
!
for(var i = 0; i < 100; i++) {!
db.t.insert({a:i});!
}!
!
var c = test.t.aggregate([{$match: {}}], {cursor: { batchSize:1 }});!
!
while(c.hasNext()) {!
print(c.next().a);!
}!
Aggregation Cursors
• You can control the behavior of the aggregation cursor
passing in the cursor option with the batchSize
> db.runCommand({aggregate: "t", pipeline: [], cursor: {batchSize: 1}!
! , allowDiskUse: true})!
{!
! "cursor" : {!
! ! "id" : NumberLong("39465949628"),!
! ! "ns" : "test.t",!
! ! "firstBatch" : [!
! ! ! {!
! ! ! ! "_id" : ObjectId("532808ea4be168cc8e9dd7dd"),!
! ! ! ! "a" : 0!
! ! ! }!
! ! ]!
! },!
! "ok" : 1!
}!
Aggregation Cursors
• Cursor id is just a normal MongoDB cursor meaning it
works like other cursors using the wire protocol call
getMore.
maxTimeMS
maxTimeMS
• Ever wanted to set a specific query or command
timeout ?
• maxTimeMS is what you’ve been looking for.
> db.t.find({"$where": "sleep(1000)"}).maxTimeMS(50)!
New or Enhanced update
operations
New or Enhanced update operations
• $mul
• $bit
• $min/$max
• $currentDate
• $push enhancements
$mul
var test = db.getSisterDB('test');!
test.t.drop();!
!
db.t.insert({ _id: 1, item: "ABC", price: 10.99 });!
!
db.t.update({ _id: 1 },!
{ $mul: { price: 1.25 } });!
!
print(db.t.findOne({_id:1}).price);!
$bit
• supports and/or/xor (xor is new)
var test = db.getSisterDB('test');!
test.t.drop();!
!
db.t.insert({ _id: 1, expdata: NumberLong(1) });!
!
db.t.update({ _id: 1 },!
{ $bit: { expdata: { xor:
NumberInt(5) } } })!
!
print(db.t.findOne({_id:1}).expdata);!
$min/$max
var test = db.getSisterDB('test');!
test.t.drop();!
!
db.t.insert({ _id: 1, desc: "crafts", !
dateEntered: ISODate("2013-10-01T05:00:00Z"),!
dateExpired: ISODate("2013-10-01T16:38:16Z")!
});!
!
db.t.update({ _id: 1 }, {!
$min: { dateEntered: new Date("2013-09-25") }!
})!
!
print(db.t.findOne({_id:1}).dateEntered);!
$currentDate
var test = db.getSisterDB('test');!
test.t.drop();!
!
db.t.insert({ _id: 1, !
! status: "a", !
! lastModified: ISODate("2013-10-02T01:11:18.965Z") });!
!
db.t.update({ _id: 1 }, {!
! $currentDate: {!
! ! lastModified: true,!
! ! lastModifiedTS: { $type: "timestamp" }},!
! $set: { status: "D" }!
});!
!
printjson(db.t.findOne({_id:1}));!
$push enhancements
var test = db.getSisterDB('test');!
test.t.drop();!
!
db.t.insert({ "_id" : 1, "scores" : [50,60,70,100 ]});!
!
db.t.update({ _id: 1 }, !
! { $push: { scores: {!
! ! ! $each: [ 20, 30 ],!
! ! ! $position: 2!
! ! }!
! }!
});!
!
printjson(db.t.findOne({_id:1}));!
New Security Model
New Security Model
• Now with
• Roles
• Rights
• You can customize the roles and rights to your liking.
• Subscription Edition also includes
• LDAP
• X509 authentication
New Security Model - Create Role Ex
var admin = db.getSisterDB('admin');!
admin.createRole({!
role: "myClusterwideAdmin",!
privileges:!
[!
{ resource: { cluster: true }, !
! actions: [ "addShard" ] },!
{ resource: { db: "config", collection: "" }, !
! actions: [ "find", "update", "insert" ] },!
{ resource: { db: "users", collection: "usersCollection" }, !
! actions: [ "update" ] },!
{ resource: { db: "", collection: "" }, !
! actions: [ "find" ] }!
],!
roles:!
[!
{ role: "read", db: "admin" }!
],!
writeConcern: { w: "majority" , wtimeout: 5000 }!
})!
Ordered/Unordered Bulk
Operations
Ordered/Unordered Bulk Operations
var test = db.getSisterDB('test');!
test.t.drop();!
!
var bulk = db.t.initializeOrderedBulkOp();!
bulk.insert({a:1});!
bulk.find({a:1}).update({$set: {b:1}});!
bulk.find({a:2}).upsert().update({$set: {b:1}});!
bulk.find({a:1}).remove();!
var result = bulk.execute({w:1});!
printjson(result);!
Ordered/Unordered Bulk Operations
• New BulkAPI shared across drivers and shell
• Uses new write Commands underneath the covers
• Splits up documents into batches
• Write Commands is the future of writing for MongoDB
• w:0 semantics is no result details when using write
commands
Ordered/Unordered Bulk Operations
• Ordered
• Execute all operations in the order they where
entered and fail on first write error
• Guarantees order of execution
• Unordered
• Executes all operations out of order and potentially
in parallel.Does not stop on error.
• Does not Guarantee order of execution
Background index building on
secondaries
Background index building on secondaries
• Previously only available on primary
• Could cause secondaries to hang
• Was not practical in many situations
• Secondaries can now build indexes in background
• Can also restart partially build indexes on instance
termination and restart
parallelCollectionScan command
parallelCollectionScan command
• Split collection into multiple cursors
• Read in parallel from the collection
• No matching semantics (it’s for pure dumping
purposes only)
parallelCollectionScan command
var test = db.getSisterDB('test');!
test.t.drop();!
!
var bulk = db.t.initializeOrderedBulkOp();!
for(var i = 0; i < 100000; i++) {!
! bulk.insert({a:i});!
};!
!
var result = bulk.execute({w:1});!
result = test.runCommand({!
! ! parallelCollectionScan: 't'!
! ,! numCursors: 4!
});!
!
printjson(result);!
ThankYou
DriverTeam Lead,Node.js driver,MongoDB INC
Christian Kvalheim
#mongodb

More Related Content

What's hot

TDC2016POA | Trilha Java - Introdução ao Byteman
TDC2016POA | Trilha Java - Introdução ao BytemanTDC2016POA | Trilha Java - Introdução ao Byteman
TDC2016POA | Trilha Java - Introdução ao Byteman
tdc-globalcode
 
Talk KVO with rac by Philippe Converset
Talk KVO with rac by Philippe ConversetTalk KVO with rac by Philippe Converset
Talk KVO with rac by Philippe Converset
CocoaHeads France
 
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Tsuyoshi Yamamoto
 
Fun Teaching MongoDB New Tricks
Fun Teaching MongoDB New TricksFun Teaching MongoDB New Tricks
Fun Teaching MongoDB New Tricks
MongoDB
 
Power shell
Power shellPower shell
Power shell
LearningTech
 
Google App Engine Developer - Day3
Google App Engine Developer - Day3Google App Engine Developer - Day3
Google App Engine Developer - Day3
Simon Su
 
Unit testing pig
Unit testing pigUnit testing pig
Unit testing pig
clintmiller1
 
The Ring programming language version 1.5.3 book - Part 40 of 184
The Ring programming language version 1.5.3 book - Part 40 of 184The Ring programming language version 1.5.3 book - Part 40 of 184
The Ring programming language version 1.5.3 book - Part 40 of 184
Mahmoud Samir Fayed
 
お題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part Aお題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part A
Kazuchika Sekiya
 
Non-Relational Postgres / Bruce Momjian (EnterpriseDB)
Non-Relational Postgres / Bruce Momjian (EnterpriseDB)Non-Relational Postgres / Bruce Momjian (EnterpriseDB)
Non-Relational Postgres / Bruce Momjian (EnterpriseDB)
Ontico
 
Writing native bindings to node.js in C++
Writing native bindings to node.js in C++Writing native bindings to node.js in C++
Writing native bindings to node.js in C++
nsm.nikhil
 
"Metrics: Where and How", Vsevolod Polyakov
"Metrics: Where and How", Vsevolod Polyakov"Metrics: Where and How", Vsevolod Polyakov
"Metrics: Where and How", Vsevolod Polyakov
Yulia Shcherbachova
 
Apache mod authまわりとか
Apache mod authまわりとかApache mod authまわりとか
Apache mod authまわりとか
Toshiyuki Terashita
 
Node.js testing
Node.js testingNode.js testing
Node.js testing
Nathachai Thongniran
 
React for Beginners
React for BeginnersReact for Beginners
React for Beginners
Derek Willian Stavis
 
Unqlite
UnqliteUnqlite
PyCon KR 2019 sprint - RustPython by example
PyCon KR 2019 sprint  - RustPython by examplePyCon KR 2019 sprint  - RustPython by example
PyCon KR 2019 sprint - RustPython by example
YunWon Jeong
 
Javascript call ObjC
Javascript call ObjCJavascript call ObjC
Javascript call ObjC
Lin Luxiang
 
New Design of OneRing
New Design of OneRingNew Design of OneRing
New Design of OneRing
Qiangning Hong
 

What's hot (19)

TDC2016POA | Trilha Java - Introdução ao Byteman
TDC2016POA | Trilha Java - Introdução ao BytemanTDC2016POA | Trilha Java - Introdução ao Byteman
TDC2016POA | Trilha Java - Introdução ao Byteman
 
Talk KVO with rac by Philippe Converset
Talk KVO with rac by Philippe ConversetTalk KVO with rac by Philippe Converset
Talk KVO with rac by Philippe Converset
 
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
 
Fun Teaching MongoDB New Tricks
Fun Teaching MongoDB New TricksFun Teaching MongoDB New Tricks
Fun Teaching MongoDB New Tricks
 
Power shell
Power shellPower shell
Power shell
 
Google App Engine Developer - Day3
Google App Engine Developer - Day3Google App Engine Developer - Day3
Google App Engine Developer - Day3
 
Unit testing pig
Unit testing pigUnit testing pig
Unit testing pig
 
The Ring programming language version 1.5.3 book - Part 40 of 184
The Ring programming language version 1.5.3 book - Part 40 of 184The Ring programming language version 1.5.3 book - Part 40 of 184
The Ring programming language version 1.5.3 book - Part 40 of 184
 
お題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part Aお題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part A
 
Non-Relational Postgres / Bruce Momjian (EnterpriseDB)
Non-Relational Postgres / Bruce Momjian (EnterpriseDB)Non-Relational Postgres / Bruce Momjian (EnterpriseDB)
Non-Relational Postgres / Bruce Momjian (EnterpriseDB)
 
Writing native bindings to node.js in C++
Writing native bindings to node.js in C++Writing native bindings to node.js in C++
Writing native bindings to node.js in C++
 
"Metrics: Where and How", Vsevolod Polyakov
"Metrics: Where and How", Vsevolod Polyakov"Metrics: Where and How", Vsevolod Polyakov
"Metrics: Where and How", Vsevolod Polyakov
 
Apache mod authまわりとか
Apache mod authまわりとかApache mod authまわりとか
Apache mod authまわりとか
 
Node.js testing
Node.js testingNode.js testing
Node.js testing
 
React for Beginners
React for BeginnersReact for Beginners
React for Beginners
 
Unqlite
UnqliteUnqlite
Unqlite
 
PyCon KR 2019 sprint - RustPython by example
PyCon KR 2019 sprint  - RustPython by examplePyCon KR 2019 sprint  - RustPython by example
PyCon KR 2019 sprint - RustPython by example
 
Javascript call ObjC
Javascript call ObjCJavascript call ObjC
Javascript call ObjC
 
New Design of OneRing
New Design of OneRingNew Design of OneRing
New Design of OneRing
 

Viewers also liked

Node.js and ruby
Node.js and rubyNode.js and ruby
Node.js and ruby
christkv
 
Slash n: Tech Talk Track 1 – Experimentation Platform - Ashok Banerjee
Slash n: Tech Talk Track 1 – Experimentation Platform - Ashok BanerjeeSlash n: Tech Talk Track 1 – Experimentation Platform - Ashok Banerjee
Slash n: Tech Talk Track 1 – Experimentation Platform - Ashok Banerjee
slashn
 
Slash n: Technical Session 2 - Messaging as a Platform - Shashwat Agarwal, V...
Slash n: Technical Session 2 - Messaging as a Platform - Shashwat Agarwal,  V...Slash n: Technical Session 2 - Messaging as a Platform - Shashwat Agarwal,  V...
Slash n: Technical Session 2 - Messaging as a Platform - Shashwat Agarwal, V...
slashn
 
Slash n: Technical Session 6 - Keeping a commercial site secure – A case stud...
Slash n: Technical Session 6 - Keeping a commercial site secure – A case stud...Slash n: Technical Session 6 - Keeping a commercial site secure – A case stud...
Slash n: Technical Session 6 - Keeping a commercial site secure – A case stud...
slashn
 
Group #5 - Flipkart_final submission
Group #5 - Flipkart_final submissionGroup #5 - Flipkart_final submission
Group #5 - Flipkart_final submission
Aritra Ganguly
 
Slash n: Tech Talk Track 1 – Art and Science of Cataloguing - Utkarsh
Slash n: Tech Talk Track 1 – Art and Science of Cataloguing - UtkarshSlash n: Tech Talk Track 1 – Art and Science of Cataloguing - Utkarsh
Slash n: Tech Talk Track 1 – Art and Science of Cataloguing - Utkarsh
slashn
 
Fungus on White Bread
Fungus on White BreadFungus on White Bread
Fungus on White Bread
Gaurav Lochan
 
Driving User Growth Through Online Marketing
Driving User Growth Through Online MarketingDriving User Growth Through Online Marketing
Driving User Growth Through Online Marketing
slashn
 
Slash n: Technical Session 8 - Making Time - minute by minute - Janmejay Singh
Slash n: Technical Session 8 - Making Time - minute by minute - Janmejay SinghSlash n: Technical Session 8 - Making Time - minute by minute - Janmejay Singh
Slash n: Technical Session 8 - Making Time - minute by minute - Janmejay Singh
slashn
 
Mongodb intro
Mongodb introMongodb intro
Mongodb intro
christkv
 
Slash n: Tech Talk Track 2 – Website Architecture-Mistakes & Learnings - Sidd...
Slash n: Tech Talk Track 2 – Website Architecture-Mistakes & Learnings - Sidd...Slash n: Tech Talk Track 2 – Website Architecture-Mistakes & Learnings - Sidd...
Slash n: Tech Talk Track 2 – Website Architecture-Mistakes & Learnings - Sidd...
slashn
 
Slash n: Technical Session 7 - Fraudsters are smart, Frank is smarter - Vivek...
Slash n: Technical Session 7 - Fraudsters are smart, Frank is smarter - Vivek...Slash n: Technical Session 7 - Fraudsters are smart, Frank is smarter - Vivek...
Slash n: Technical Session 7 - Fraudsters are smart, Frank is smarter - Vivek...
slashn
 
Slash n: Tech Talk Track 2 – Distributed Transactions in SOA - Yogi Kulkarni,...
Slash n: Tech Talk Track 2 – Distributed Transactions in SOA - Yogi Kulkarni,...Slash n: Tech Talk Track 2 – Distributed Transactions in SOA - Yogi Kulkarni,...
Slash n: Tech Talk Track 2 – Distributed Transactions in SOA - Yogi Kulkarni,...
slashn
 
Mongo db ecommerce
Mongo db ecommerceMongo db ecommerce
Mongo db ecommerce
christkv
 
Building Your First App with MongoDB
Building Your First App with MongoDBBuilding Your First App with MongoDB
Building Your First App with MongoDB
MongoDB
 
How Flipkart scales PHP
How Flipkart scales PHPHow Flipkart scales PHP
How Flipkart scales PHP
Siddhartha Reddy Kothakapu
 
Seminario Web MongoDB-Paradigma: Cree aplicaciones más escalables utilizando ...
Seminario Web MongoDB-Paradigma: Cree aplicaciones más escalables utilizando ...Seminario Web MongoDB-Paradigma: Cree aplicaciones más escalables utilizando ...
Seminario Web MongoDB-Paradigma: Cree aplicaciones más escalables utilizando ...
MongoDB
 

Viewers also liked (17)

Node.js and ruby
Node.js and rubyNode.js and ruby
Node.js and ruby
 
Slash n: Tech Talk Track 1 – Experimentation Platform - Ashok Banerjee
Slash n: Tech Talk Track 1 – Experimentation Platform - Ashok BanerjeeSlash n: Tech Talk Track 1 – Experimentation Platform - Ashok Banerjee
Slash n: Tech Talk Track 1 – Experimentation Platform - Ashok Banerjee
 
Slash n: Technical Session 2 - Messaging as a Platform - Shashwat Agarwal, V...
Slash n: Technical Session 2 - Messaging as a Platform - Shashwat Agarwal,  V...Slash n: Technical Session 2 - Messaging as a Platform - Shashwat Agarwal,  V...
Slash n: Technical Session 2 - Messaging as a Platform - Shashwat Agarwal, V...
 
Slash n: Technical Session 6 - Keeping a commercial site secure – A case stud...
Slash n: Technical Session 6 - Keeping a commercial site secure – A case stud...Slash n: Technical Session 6 - Keeping a commercial site secure – A case stud...
Slash n: Technical Session 6 - Keeping a commercial site secure – A case stud...
 
Group #5 - Flipkart_final submission
Group #5 - Flipkart_final submissionGroup #5 - Flipkart_final submission
Group #5 - Flipkart_final submission
 
Slash n: Tech Talk Track 1 – Art and Science of Cataloguing - Utkarsh
Slash n: Tech Talk Track 1 – Art and Science of Cataloguing - UtkarshSlash n: Tech Talk Track 1 – Art and Science of Cataloguing - Utkarsh
Slash n: Tech Talk Track 1 – Art and Science of Cataloguing - Utkarsh
 
Fungus on White Bread
Fungus on White BreadFungus on White Bread
Fungus on White Bread
 
Driving User Growth Through Online Marketing
Driving User Growth Through Online MarketingDriving User Growth Through Online Marketing
Driving User Growth Through Online Marketing
 
Slash n: Technical Session 8 - Making Time - minute by minute - Janmejay Singh
Slash n: Technical Session 8 - Making Time - minute by minute - Janmejay SinghSlash n: Technical Session 8 - Making Time - minute by minute - Janmejay Singh
Slash n: Technical Session 8 - Making Time - minute by minute - Janmejay Singh
 
Mongodb intro
Mongodb introMongodb intro
Mongodb intro
 
Slash n: Tech Talk Track 2 – Website Architecture-Mistakes & Learnings - Sidd...
Slash n: Tech Talk Track 2 – Website Architecture-Mistakes & Learnings - Sidd...Slash n: Tech Talk Track 2 – Website Architecture-Mistakes & Learnings - Sidd...
Slash n: Tech Talk Track 2 – Website Architecture-Mistakes & Learnings - Sidd...
 
Slash n: Technical Session 7 - Fraudsters are smart, Frank is smarter - Vivek...
Slash n: Technical Session 7 - Fraudsters are smart, Frank is smarter - Vivek...Slash n: Technical Session 7 - Fraudsters are smart, Frank is smarter - Vivek...
Slash n: Technical Session 7 - Fraudsters are smart, Frank is smarter - Vivek...
 
Slash n: Tech Talk Track 2 – Distributed Transactions in SOA - Yogi Kulkarni,...
Slash n: Tech Talk Track 2 – Distributed Transactions in SOA - Yogi Kulkarni,...Slash n: Tech Talk Track 2 – Distributed Transactions in SOA - Yogi Kulkarni,...
Slash n: Tech Talk Track 2 – Distributed Transactions in SOA - Yogi Kulkarni,...
 
Mongo db ecommerce
Mongo db ecommerceMongo db ecommerce
Mongo db ecommerce
 
Building Your First App with MongoDB
Building Your First App with MongoDBBuilding Your First App with MongoDB
Building Your First App with MongoDB
 
How Flipkart scales PHP
How Flipkart scales PHPHow Flipkart scales PHP
How Flipkart scales PHP
 
Seminario Web MongoDB-Paradigma: Cree aplicaciones más escalables utilizando ...
Seminario Web MongoDB-Paradigma: Cree aplicaciones más escalables utilizando ...Seminario Web MongoDB-Paradigma: Cree aplicaciones más escalables utilizando ...
Seminario Web MongoDB-Paradigma: Cree aplicaciones más escalables utilizando ...
 

Similar to New in MongoDB 2.6

Testing stateful, concurrent, and async systems using test.check
Testing stateful, concurrent, and async systems using test.checkTesting stateful, concurrent, and async systems using test.check
Testing stateful, concurrent, and async systems using test.check
Eric Normand
 
Mongo db勉強会20110730
Mongo db勉強会20110730Mongo db勉強会20110730
Mongo db勉強会20110730
Akihiro Okuno
 
Latinoware
LatinowareLatinoware
Latinoware
kchodorow
 
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
Christopher Bartling
 
Apache Cassandra and Go
Apache Cassandra and GoApache Cassandra and Go
Apache Cassandra and Go
DataStax Academy
 
The Art Of Readable Code
The Art Of Readable CodeThe Art Of Readable Code
The Art Of Readable Code
Baidu, Inc.
 
Introduction to Scalding and Monoids
Introduction to Scalding and MonoidsIntroduction to Scalding and Monoids
Introduction to Scalding and Monoids
Hugo Gävert
 
Whats new in mongoDB 2.4 at Copenhagen user group 2013-06-19
Whats new in mongoDB 2.4 at Copenhagen user group 2013-06-19Whats new in mongoDB 2.4 at Copenhagen user group 2013-06-19
Whats new in mongoDB 2.4 at Copenhagen user group 2013-06-19
Henrik Ingo
 
MongoDB World 2018: Keynote
MongoDB World 2018: KeynoteMongoDB World 2018: Keynote
MongoDB World 2018: Keynote
MongoDB
 
Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenery
toddbr
 
Test-Driven Development of AngularJS Applications
Test-Driven Development of AngularJS ApplicationsTest-Driven Development of AngularJS Applications
Test-Driven Development of AngularJS Applications
FITC
 
Lie to Me: Bypassing Modern Web Application Firewalls
Lie to Me: Bypassing Modern Web Application FirewallsLie to Me: Bypassing Modern Web Application Firewalls
Lie to Me: Bypassing Modern Web Application Firewalls
Ivan Novikov
 
MongoDB: tips, trick and hacks
MongoDB: tips, trick and hacksMongoDB: tips, trick and hacks
MongoDB: tips, trick and hacks
Scott Hernandez
 
A la découverte de TypeScript
A la découverte de TypeScriptA la découverte de TypeScript
A la découverte de TypeScript
Denis Voituron
 
Matthew Eernisse, NodeJs, .toster {webdev}
Matthew Eernisse, NodeJs, .toster {webdev}Matthew Eernisse, NodeJs, .toster {webdev}
Matthew Eernisse, NodeJs, .toster {webdev}
.toster
 
NodeJS
NodeJSNodeJS
NodeJS
.toster
 
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
BradNeuberg
 
DIG1108C Lesson 6 - Fall 2014
DIG1108C Lesson 6 - Fall 2014DIG1108C Lesson 6 - Fall 2014
DIG1108C Lesson 6 - Fall 2014
David Wolfpaw
 
Unit testing JavaScript using Mocha and Node
Unit testing JavaScript using Mocha and NodeUnit testing JavaScript using Mocha and Node
Unit testing JavaScript using Mocha and Node
Josh Mock
 
mobl presentation @ IHomer
mobl presentation @ IHomermobl presentation @ IHomer
mobl presentation @ IHomer
zefhemel
 

Similar to New in MongoDB 2.6 (20)

Testing stateful, concurrent, and async systems using test.check
Testing stateful, concurrent, and async systems using test.checkTesting stateful, concurrent, and async systems using test.check
Testing stateful, concurrent, and async systems using test.check
 
Mongo db勉強会20110730
Mongo db勉強会20110730Mongo db勉強会20110730
Mongo db勉強会20110730
 
Latinoware
LatinowareLatinoware
Latinoware
 
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
 
Apache Cassandra and Go
Apache Cassandra and GoApache Cassandra and Go
Apache Cassandra and Go
 
The Art Of Readable Code
The Art Of Readable CodeThe Art Of Readable Code
The Art Of Readable Code
 
Introduction to Scalding and Monoids
Introduction to Scalding and MonoidsIntroduction to Scalding and Monoids
Introduction to Scalding and Monoids
 
Whats new in mongoDB 2.4 at Copenhagen user group 2013-06-19
Whats new in mongoDB 2.4 at Copenhagen user group 2013-06-19Whats new in mongoDB 2.4 at Copenhagen user group 2013-06-19
Whats new in mongoDB 2.4 at Copenhagen user group 2013-06-19
 
MongoDB World 2018: Keynote
MongoDB World 2018: KeynoteMongoDB World 2018: Keynote
MongoDB World 2018: Keynote
 
Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenery
 
Test-Driven Development of AngularJS Applications
Test-Driven Development of AngularJS ApplicationsTest-Driven Development of AngularJS Applications
Test-Driven Development of AngularJS Applications
 
Lie to Me: Bypassing Modern Web Application Firewalls
Lie to Me: Bypassing Modern Web Application FirewallsLie to Me: Bypassing Modern Web Application Firewalls
Lie to Me: Bypassing Modern Web Application Firewalls
 
MongoDB: tips, trick and hacks
MongoDB: tips, trick and hacksMongoDB: tips, trick and hacks
MongoDB: tips, trick and hacks
 
A la découverte de TypeScript
A la découverte de TypeScriptA la découverte de TypeScript
A la découverte de TypeScript
 
Matthew Eernisse, NodeJs, .toster {webdev}
Matthew Eernisse, NodeJs, .toster {webdev}Matthew Eernisse, NodeJs, .toster {webdev}
Matthew Eernisse, NodeJs, .toster {webdev}
 
NodeJS
NodeJSNodeJS
NodeJS
 
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
 
DIG1108C Lesson 6 - Fall 2014
DIG1108C Lesson 6 - Fall 2014DIG1108C Lesson 6 - Fall 2014
DIG1108C Lesson 6 - Fall 2014
 
Unit testing JavaScript using Mocha and Node
Unit testing JavaScript using Mocha and NodeUnit testing JavaScript using Mocha and Node
Unit testing JavaScript using Mocha and Node
 
mobl presentation @ IHomer
mobl presentation @ IHomermobl presentation @ IHomer
mobl presentation @ IHomer
 

More from christkv

From SQL to MongoDB
From SQL to MongoDBFrom SQL to MongoDB
From SQL to MongoDB
christkv
 
Lessons from 4 years of driver develoment
Lessons from 4 years of driver develomentLessons from 4 years of driver develoment
Lessons from 4 years of driver develoment
christkv
 
Storage talk
Storage talkStorage talk
Storage talk
christkv
 
Cdr stats-vo ip-analytics_solution_mongodb_meetup
Cdr stats-vo ip-analytics_solution_mongodb_meetupCdr stats-vo ip-analytics_solution_mongodb_meetup
Cdr stats-vo ip-analytics_solution_mongodb_meetup
christkv
 
Schema design
Schema designSchema design
Schema design
christkv
 
Node js mongodriver
Node js mongodriverNode js mongodriver
Node js mongodriver
christkv
 

More from christkv (6)

From SQL to MongoDB
From SQL to MongoDBFrom SQL to MongoDB
From SQL to MongoDB
 
Lessons from 4 years of driver develoment
Lessons from 4 years of driver develomentLessons from 4 years of driver develoment
Lessons from 4 years of driver develoment
 
Storage talk
Storage talkStorage talk
Storage talk
 
Cdr stats-vo ip-analytics_solution_mongodb_meetup
Cdr stats-vo ip-analytics_solution_mongodb_meetupCdr stats-vo ip-analytics_solution_mongodb_meetup
Cdr stats-vo ip-analytics_solution_mongodb_meetup
 
Schema design
Schema designSchema design
Schema design
 
Node js mongodriver
Node js mongodriverNode js mongodriver
Node js mongodriver
 

Recently uploaded

How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
flufftailshop
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 

Recently uploaded (20)

How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 

New in MongoDB 2.6

  • 1. What’s new in 2.6 DriverTeam Lead,Node.js driver,MongoDB INC Christian Kvalheim #mongodb
  • 2. Me • Driver Team Lead • Node.js driver developer • @christkv • http://www.christiankvalheim.com
  • 3. Agenda • Aggregation Cursors • maxTimeMS • New or Enhanced update operations • New Security Model • Ordered/Unordered Bulk Operations • Background index building on secondaries • parallelCollectionScan command
  • 5. Aggregation Cursors • Aggregation framework can now return a cursor var test = db.getSisterDB('test');! test.t.drop();! ! for(var i = 0; i < 100; i++) {! db.t.insert({a:i});! }! ! var c = test.t.aggregate([{$match: {}}], {cursor: { batchSize:1 }});! ! while(c.hasNext()) {! print(c.next().a);! }!
  • 6. Aggregation Cursors • You can control the behavior of the aggregation cursor passing in the cursor option with the batchSize > db.runCommand({aggregate: "t", pipeline: [], cursor: {batchSize: 1}! ! , allowDiskUse: true})! {! ! "cursor" : {! ! ! "id" : NumberLong("39465949628"),! ! ! "ns" : "test.t",! ! ! "firstBatch" : [! ! ! ! {! ! ! ! ! "_id" : ObjectId("532808ea4be168cc8e9dd7dd"),! ! ! ! ! "a" : 0! ! ! ! }! ! ! ]! ! },! ! "ok" : 1! }!
  • 7. Aggregation Cursors • Cursor id is just a normal MongoDB cursor meaning it works like other cursors using the wire protocol call getMore.
  • 9. maxTimeMS • Ever wanted to set a specific query or command timeout ? • maxTimeMS is what you’ve been looking for. > db.t.find({"$where": "sleep(1000)"}).maxTimeMS(50)!
  • 10. New or Enhanced update operations
  • 11. New or Enhanced update operations • $mul • $bit • $min/$max • $currentDate • $push enhancements
  • 12. $mul var test = db.getSisterDB('test');! test.t.drop();! ! db.t.insert({ _id: 1, item: "ABC", price: 10.99 });! ! db.t.update({ _id: 1 },! { $mul: { price: 1.25 } });! ! print(db.t.findOne({_id:1}).price);!
  • 13. $bit • supports and/or/xor (xor is new) var test = db.getSisterDB('test');! test.t.drop();! ! db.t.insert({ _id: 1, expdata: NumberLong(1) });! ! db.t.update({ _id: 1 },! { $bit: { expdata: { xor: NumberInt(5) } } })! ! print(db.t.findOne({_id:1}).expdata);!
  • 14. $min/$max var test = db.getSisterDB('test');! test.t.drop();! ! db.t.insert({ _id: 1, desc: "crafts", ! dateEntered: ISODate("2013-10-01T05:00:00Z"),! dateExpired: ISODate("2013-10-01T16:38:16Z")! });! ! db.t.update({ _id: 1 }, {! $min: { dateEntered: new Date("2013-09-25") }! })! ! print(db.t.findOne({_id:1}).dateEntered);!
  • 15. $currentDate var test = db.getSisterDB('test');! test.t.drop();! ! db.t.insert({ _id: 1, ! ! status: "a", ! ! lastModified: ISODate("2013-10-02T01:11:18.965Z") });! ! db.t.update({ _id: 1 }, {! ! $currentDate: {! ! ! lastModified: true,! ! ! lastModifiedTS: { $type: "timestamp" }},! ! $set: { status: "D" }! });! ! printjson(db.t.findOne({_id:1}));!
  • 16. $push enhancements var test = db.getSisterDB('test');! test.t.drop();! ! db.t.insert({ "_id" : 1, "scores" : [50,60,70,100 ]});! ! db.t.update({ _id: 1 }, ! ! { $push: { scores: {! ! ! ! $each: [ 20, 30 ],! ! ! ! $position: 2! ! ! }! ! }! });! ! printjson(db.t.findOne({_id:1}));!
  • 18. New Security Model • Now with • Roles • Rights • You can customize the roles and rights to your liking. • Subscription Edition also includes • LDAP • X509 authentication
  • 19. New Security Model - Create Role Ex var admin = db.getSisterDB('admin');! admin.createRole({! role: "myClusterwideAdmin",! privileges:! [! { resource: { cluster: true }, ! ! actions: [ "addShard" ] },! { resource: { db: "config", collection: "" }, ! ! actions: [ "find", "update", "insert" ] },! { resource: { db: "users", collection: "usersCollection" }, ! ! actions: [ "update" ] },! { resource: { db: "", collection: "" }, ! ! actions: [ "find" ] }! ],! roles:! [! { role: "read", db: "admin" }! ],! writeConcern: { w: "majority" , wtimeout: 5000 }! })!
  • 21. Ordered/Unordered Bulk Operations var test = db.getSisterDB('test');! test.t.drop();! ! var bulk = db.t.initializeOrderedBulkOp();! bulk.insert({a:1});! bulk.find({a:1}).update({$set: {b:1}});! bulk.find({a:2}).upsert().update({$set: {b:1}});! bulk.find({a:1}).remove();! var result = bulk.execute({w:1});! printjson(result);!
  • 22. Ordered/Unordered Bulk Operations • New BulkAPI shared across drivers and shell • Uses new write Commands underneath the covers • Splits up documents into batches • Write Commands is the future of writing for MongoDB • w:0 semantics is no result details when using write commands
  • 23. Ordered/Unordered Bulk Operations • Ordered • Execute all operations in the order they where entered and fail on first write error • Guarantees order of execution • Unordered • Executes all operations out of order and potentially in parallel.Does not stop on error. • Does not Guarantee order of execution
  • 24. Background index building on secondaries
  • 25. Background index building on secondaries • Previously only available on primary • Could cause secondaries to hang • Was not practical in many situations • Secondaries can now build indexes in background • Can also restart partially build indexes on instance termination and restart
  • 27. parallelCollectionScan command • Split collection into multiple cursors • Read in parallel from the collection • No matching semantics (it’s for pure dumping purposes only)
  • 28. parallelCollectionScan command var test = db.getSisterDB('test');! test.t.drop();! ! var bulk = db.t.initializeOrderedBulkOp();! for(var i = 0; i < 100000; i++) {! ! bulk.insert({a:i});! };! ! var result = bulk.execute({w:1});! result = test.runCommand({! ! ! parallelCollectionScan: 't'! ! ,! numCursors: 4! });! ! printjson(result);!
  • 29. ThankYou DriverTeam Lead,Node.js driver,MongoDB INC Christian Kvalheim #mongodb