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
Ad

More Related Content

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
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
Unqlite
Paul Myeongchan Kim
 
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
 
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
 
Google App Engine Developer - Day3
Google App Engine Developer - Day3Google App Engine Developer - Day3
Google App Engine Developer - Day3
Simon Su
 
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
 
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
 

Viewers also liked (17)

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
 
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
 
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
 
Ad

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
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
 
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
 
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
 
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
 
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
 
Ad

More from christkv (6)

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
 
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
 

Recently uploaded (20)

Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 

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