SlideShare a Scribd company logo
1 of 104
MONGOOSE V3
   Looking ahead




                          jsconf.ar 2012
                   @aaronheckmann
MONGOOSE V3
MONGOOSE V3
•What’s wrong
MONGOOSE V3
•What’s wrong
•The Fix
MONGOOSE V3
•What’s wrong
•The Fix
•Improvements
MONGOOSE V3
•What’s wrong
•The Fix
•Improvements
•Support
MONGOOSE V3
  The Future Is Bright
MONGOOSE V3
What’s Wrong?
MONGOOSE V3
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!


 -- Tim Peters,    The Zen of Python     http://www.python.org/dev/peps/pep-0020/
MONGOOSE V3
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.

       There should be one--
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.


         and preferably only one
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.

        --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!


 -- Tim Peters,    The Zen of Python     http://www.python.org/dev/peps/pep-0020/
MONGOOSE V3
One way
MONGOOSE V3
One way


 User.where(‘age’).$gt(17).select(‘name’).exec(cb)
 User.where(‘age’).gt(17).select({‘name’: 1}).exec(cb)
 User.where(‘age’).gt(17).select(‘name’, 1).run(cb)
 User.find({ age: { $gt: 17 }}).select([‘name’]).exec(cb)
 User.find({ age: { $gt: 17 }}, [‘name’]).run(cb)
MONGOOSE V3
One way


 User.where(‘age’).$gt(17).select(‘name’).exec(cb)
 User.where(‘age’).gt(17).select({‘name’: 1}).exec(cb)
 User.where(‘age’).gt(17).select(‘name’, 1).run(cb)
 User.find({ age: { $gt: 17 }}).select([‘name’]).exec(cb)
 User.find({ age: { $gt: 17 }}, [‘name’]).run(cb)
MONGOOSE V3
One way


 User.where(‘age’).$gt(17).select(‘name’).exec(cb)
 User.where(‘age’).gt(17).select({‘name’: 1}).exec(cb)
 User.where(‘age’).gt(17).select(‘name’, 1).run(cb)
 User.find({ age: { $gt: 17 }}).select([‘name’]).exec(cb)
 User.find({ age: { $gt: 17 }}, [‘name’]).run(cb)
MONGOOSE V3
One way


 User.where(‘age’).$gt(17).select(‘name’).exec(cb)
 User.where(‘age’).gt(17).select({‘name’: 1}).exec(cb)
 User.where(‘age’).gt(17).select(‘name’, 1).run(cb)
 User.find({ age: { $gt: 17 }}).select([‘name’]).exec(cb)
 User.find({ age: { $gt: 17 }}, [‘name’]).run(cb)
MONGOOSE V3
One way


 User.where(‘age’).$gt(17).select(‘name’).exec(cb)
 User.where(‘age’).gt(17).select({‘name’: 1}).exec(cb)
 User.where(‘age’).gt(17).select(‘name’, 1).run(cb)
 User.find({ age: { $gt: 17 }}).select([‘name’]).exec(cb)
 User.find({ age: { $gt: 17 }}, [‘name’]).run(cb)
MONGOOSE V3




http://www.motifake.com/image/demotivational-poster/1106/determination-determination-faceplant-demotivational-posters-1307398930.jpg
MONGOOSE V3
API pollution
 Query methods

$or -> or     $in -> in         $near -> near
$nor -> nor   $nin -> nin       $within -> within
$gt -> gt     $all -> all       $box -> box
$gte -> gte   $regex ->regex    $center - > center
$lt -> lt     $size -> size     $centerSphere -> centerSphere
$lte -> lte   $slice -> slice   $maxDistance ->maxDistance
MONGOOSE V3
API pollution
 Query methods

$ne -> ne                  only -> select({ path: 1 })
$mod -> mod                exclude -> select({ path: 0 })
$exists -> exists          run -> exec
$elemMatch -> elemMatch    notEqualTo -> ne
asc -> sort({ path: 1 })   wherein -> within
desc -> sort({ path: 0})   fields -> select
MONGOOSE V3
API pollution
 Connection methods

createConnection
createSetConnection
connect
connectSet
MONGOOSE V3
The Fix?


createConnection       $nin -> nin                     $ne -> ne
createSetConnection    $all -> all                     $mod -> mod
connect                $regex -> regex                 $exists -> exists
connectSet             $size -> size                   $elemMatch -> elemMatch
$or -> or              $slice -> slice                 asc -> sort({ path: 1 })
$nor -> nor            $near -> near                   desc -> sort({ path: 0})
$gt -> gt              $within -> within               only -> select({ path: 1 })
$gte -> gte            $box -> box                     exclude -> select({ path: 0 })
$lt -> lt              $center -> center               run -> exec
$lte -> lte            $centerSphere -> centerSphere   notEqualTo -> ne
$in -> in              $maxDistance -> maxDistance     wherein -> within
                                                       fields -> select
MONGOOSE V3
The Fix
 kill all the things

createConnection       $nin -> nin                     $ne -> ne
createSetConnection    $all -> all                     $mod -> mod
connect                $regex -> regex                 $exists -> exists
connectSet             $size -> size                   $elemMatch -> elemMatch
$or -> or              $slice -> slice                 asc -> sort({ path: 1 })
$nor -> nor            $near -> near                   desc -> sort({ path: 0})
$gt -> gt              $within -> within               only -> select({ path: 1 })
$gte -> gte            $box -> box                     exclude -> select({ path: 0 })
$lt -> lt              $center -> center               run -> exec
$lte -> lte            $centerSphere -> centerSphere   notEqualTo -> ne
$in -> in              $maxDistance -> maxDistance     wherein -> within
                                                       fields -> select
MONGOOSE V3
The Fix
 kill all the things

createConnection       $nin -> nin                     $ne -> ne
createSetConnection    $all -> all                     $mod -> mod
connect                $regex -> regex                 $exists -> exists
connectSet             $size -> size                   $elemMatch -> elemMatch
$or -> or              $slice -> slice                 asc -> sort({ path: 1 })
$nor -> nor            $near -> near                   desc -> sort({ path: 0})
$gt -> gt              $within -> within               only -> select({ path: 1 })
$gte -> gte            $box -> box                     exclude -> select({ path: 0 })
$lt -> lt              $center -> center               run -> exec
$lte -> lte            $centerSphere -> centerSphere   notEqualTo -> ne
$in -> in              $maxDistance -> maxDistance     wherein -> within
                                                       fields -> select


                                                         http://soundbible.com/1575-High-Definition-Machine-Gun.html
                                                         http://openclipart.org/detail/20561/set-of-bullet-holes-by-rg1024
MONGOOSE V3
The Fix
 remove query aliases

Coffee.where(‘flavor’).$in(array).run()
MONGOOSE V3
The Fix
 remove query aliases

Coffee.where(‘flavor’).$in(array).run()   Coffee.where(‘flavor’).in(array).exec()
MONGOOSE V3
The Fix
 remove query aliases

Coffee.where(‘flavor’).$in(array).run()   Coffee.where(‘flavor’).in(array).exec()
MONGOOSE V3
The Fix
 remove query aliases

Coffee.find().asc(‘flavor’).run()
MONGOOSE V3
The Fix
 remove query aliases

Coffee.find().asc(‘flavor’).run()   Coffee.find().sort(‘flavor’).exec()
MONGOOSE V3
The Fix
 remove query aliases

Coffee.find().asc(‘flavor’).run()   Coffee.find().sort(‘flavor’).exec()
MONGOOSE V3
The Fix
 Combine connection methods

goose.createSetConnection(connString)
MONGOOSE V3
The Fix
 Combine connection methods

goose.createSetConnection(connString)


                                        goose.createConnection(connString)
MONGOOSE V3
The Fix
 Combine connection methods

mongoose.connectSet(connString)
MONGOOSE V3
The Fix
 Combine connection methods

mongoose.connectSet(connString)


                                  mongoose.connect(connString)
MONGOOSE V3
What’s Wrong?
MONGOOSE V3
What’s Wrong?
 Query method arguments
MONGOOSE V3
What’s Wrong?
 Query method arguments

query.select(array)
query.select(‘path’, 1, ‘path’, 1)
query.select({ key: 0 })
query.select(‘space delimited’)

query.hint(‘path’, 1, ‘path’, 1)
query.hint({ key: 1})
MONGOOSE V3
What’s Wrong?
 Query method arguments

query.select(array)
query.select(‘path’, 1, ‘path’, 1)
query.select({ key: 0 })
query.select(‘space delimited’)

query.hint(‘path’, 1, ‘path’, 1)
query.hint({ key: 1})
MONGOOSE V3
The Fix
 Query method arguments

query.select(‘include -exclude’)
MONGOOSE V3
The Fix
 Query method arguments

query.select(‘include -exclude’)
query.select({ include: 1, exclude: 0 })
MONGOOSE V3
The Fix
 Query method arguments

query.select({ include: 1, exclude: 0 })
query.select(‘include -exclude’)

query.sort({ include: 1, exclude: 0 })
query.sort(‘include -exclude’)
MONGOOSE V3
Missing MongoDB features
MONGOOSE V3
Missing MongoDB features
MONGOOSE V3
Missing MongoDB features
MONGOOSE V3
Missing MongoDB features

•Map Reduce
MONGOOSE V3
Missing MongoDB features

•Map Reduce
 var o = { map: mapFn, reduce: rFn }

 Talks.mapReduce(o, function (err, res) {
    console.log(res)
 })
MONGOOSE V3
Missing MongoDB features

•Map Reduce
 var o = { map: mapFn, reduce: rFn }
 o.out = { replace: ‘mapped_talks’ }

 Talks.mapReduce(o, function (err, res) {
    res.find().where().exec(function (err, docs) {
       console.log(res)
    })
 })
MONGOOSE V3
Missing MongoDB features

•FindAndModify
MONGOOSE V3
Missing MongoDB features

•FindAndModify
 // old way
 var o = { _id: anObjectId }

 Talks.findOne(o, function (err, doc) {
    doc.name = ‘peanut butter’;
    doc.save()
 })
MONGOOSE V3
Missing MongoDB features

•FindAndModify
 // new way
 var o = { _id: anObjectId }
   , up = { $set: { name: ‘peanut butter’}}

 Talks.findOneAndUpdate(o, up, function (err, doc) {
    console.log(doc)
 })
MONGOOSE V3
Missing MongoDB features

•FindAndModify
 var o = { name: ‘peanut butter’ }

 Talks.findOneAndRemove(o, function (err, res) {
    console.log(res)
 })
MONGOOSE V3
Missing MongoDB features

•FindAndModify
 Talks.findByIdAndUpdate(id, update, cb)
 Talks.findByIdAndRemove(id, update, cb)
MONGOOSE V3
Missing MongoDB features

•Map Reduce
•FindAndModify
•Capped collections *




                            * soon!
MONGOOSE V3
Missing MongoDB features

•Map Reduce
•FindAndModify
•Capped collections *
•Aggregation *



                            * soon!
MONGOOSE V3
Missing MongoDB features

•Aggregation
  Article.aggregate(
      { $project : { author : 1, tags : 1 }}
    , { $unwind : "$tags" }
    , { $group : {
          _id : { tags : 1 }
        , authors : { $addToSet : "$author" }
      }
  });

                                                * soon!
MONGOOSE V3
Missing MongoDB features

•Aggregation
  Article.aggregate(
      { $project : { author : 1, tags : 1 }}
    , { $unwind : "$tags" }
    , { $group : {
          _id : { tags : 1 }
        , authors : { $addToSet : "$author" }
      }
  });

                                                * soon!
MONGOOSE V3
Missing MongoDB features

•Aggregation
  Article.aggregate(
      { $project : { author : 1, tags : 1 }}
    , { $unwind : "$tags" }
    , { $group : {
          _id : { tags : 1 }
        , authors : { $addToSet : "$author" }
      }
  });

                                                * soon!
MONGOOSE V3
Missing MongoDB features

•Aggregation
  Article.aggregate(
      { $project : { author : 1, tags : 1 }}
    , { $unwind : "$tags" }
    , { $group : {
          _id : { tags : 1 }
        , authors : { $addToSet : "$author" }
      }
  });

                                                * soon!
MONGOOSE V3
Missing MongoDB features

•Aggregation
  Article.aggregate(
      { $project : { author : 1, tags : 1 }}
    , { $unwind : "$tags" }
    , { $group : {
          _id : { tags : 1 }
        , authors : { $addToSet : "$author" }
      }
  });

                                                * soon!
MONGOOSE V3
Missing MongoDB features

•Aggregation
  Article.aggregate(
      { $project : { author : 1, tags : 1 }}
    , { $unwind : "$tags" }
    , { $group : {
          _id : { tags : 1 }
        , authors : { $addToSet : "$author" }
      }
  });

                                                * soon!
MONGOOSE V3
Missing MongoDB features

•Map Reduce
•FindAndModify
•Capped collections *
•Aggregation *
•Improved geo-spatial support *


                                  * soon!
MONGOOSE V3
Performance
MONGOOSE V3
Performance

•lean queries
MONGOOSE V3
Performance

•lean queries

 Talks
 .findOne()
 .exec(function (err, doc) {
    // doc.save()
 })
MONGOOSE V3
Performance

•lean queries

 Talks
 .findOne()
 .setOptions({ lean: true })
 .exec(function (err, doc) {
    // doc.save
 })
MONGOOSE V3
Performance

•lean queries

 Talks
 .findOne()
 .setOptions({ lean: true })
 .exec(function (err, doc) {
    // doc.save -> undefined
 })
MONGOOSE V3
Performance

•lean queries
•background indexes
MONGOOSE V3
Performance

•lean queries
•background indexes
•connection pool size?
MONGOOSE V3
Performance

•lean queries
•background indexes
•connection pool size?
•memory usage?
MONGOOSE V3
General Improvements
MONGOOSE V3
General Improvements

•Improved update command generation for arrays
MONGOOSE V3
General Improvements

•Improved update command generation for arrays
 var schema = new Schema({ tags: [], name: String })
MONGOOSE V3
General Improvements

•Improved update command generation for arrays
 var schema = new Schema({ tags: [], name: String })
 var Talks = db.model(‘Talk’, schema)
MONGOOSE V3
General Improvements

•Improved update command generation for arrays
 var schema = new Schema({ tags: [], name: String })
 var Talks = db.model(‘Talk’, schema)
 Talks.findById(id, function (err, talk) {
    talk.name = ‘peanut butter’
    talk.tags.push(‘nerdcore’)
    talk.save(callback)
 })
MONGOOSE V3
General Improvements

•Improved update command generation for arrays
 var schema = new Schema({ tags: [], name: String })
 var Talks = db.model(‘Talk’, schema)
 Talks.findById(id, function (err, talk) {
    talk.name = ‘peanut butter’
    talk.tags.push(‘nerdcore’)
    talk.save(callback) // magic!
 })
MONGOOSE V3
General Improvements

•Improved update command generation for arrays
 Object.defineProperty(talk, ‘name’, {
      get: function () { return this.smth }
    , set: function (v){
        this.smth = v
      }
 })
MONGOOSE V3
General Improvements

•Improved update command generation for arrays
 Object.defineProperty(talk, ‘name’, {
      get: function () { return this.smth }
    , set: function (v){
        record(‘name’);
        this.smth = v
      }
 })
MONGOOSE V3
General Improvements

•Improved update command generation for arrays
 Object.defineProperty(talk, ‘name’, {
      get: function () { return this.smth }
    , set: function (v){
        this._set = {}
        this._set[‘name’] = v
        this.smth = v
      }
 })
MONGOOSE V3
General Improvements

•Improved update command generation for arrays
 talk.save() ->
   var update = {};
   update.$set = talk._set;
   Talks.update({ _id: talk._id }, update, callback)
MONGOOSE V3
General Improvements

•Improved update command generation for arrays
 talk.tags.push = function () {
   record(‘push’, arguments)
 }
MONGOOSE V3
General Improvements

•Improved update command generation for arrays
 talk.tags.push = function () {
   record(‘push’, arguments)
 }

 talk.save() ->
   var update = {};
   update.$pushAll = { tags: args }
   Talk.update({_id:talk._id}, update, callback)
MONGOOSE V3
General Improvements

•Improved update command generation for arrays
 talk.tags.push(‘nerdcore’)
 talk.tags.remove(‘php’)
 talk.save(callback) // fail!
MONGOOSE V3
General Improvements

•Improved update command generation for arrays
 talk.tags.push(‘nerdcore’)
 talk.tags.remove(‘php’)
 talk.save(callback) // success!!
MONGOOSE V3
General Improvements

•Simplify schema declaration
MONGOOSE V3
General Improvements

•Simplify schema declaration
  var personSchema = new Schema({
       name: String
     , val: Number
     , buffer: Buffer
     , array: Array
     , etc: ...
  })
MONGOOSE V3
General Improvements

•Simplify schema declaration
  var personSchema = new Schema({
       name: ‘string’
     , val: ‘number’
     , buffer: ‘buffer’
     , array: ‘array’
     , etc: ...
  })
MONGOOSE V3
General Improvements

•Hardened schema ‘strict’ option
  var personSchema = new Schema({
      name: ‘string’
    , val: ‘number’
    , buffer: ‘buffer’
    , array: ‘array’
    , etc: ...
  }, { strict: true })
MONGOOSE V3
General Improvements

•Hardened schema ‘strict’ option
  var personSchema = new Schema({
      name: ‘string’
    , val: ‘number’
    , buffer: ‘buffer’
    , array: ‘array’
    , etc: ...
  }, { strict: ‘throw’ })
MONGOOSE V3
General Improvements

•Hardened schema ‘strict’ option

  new Person({ notExists: ‘3vil’ })
MONGOOSE V3
General Improvements

•Hardened schema ‘strict’ option

  new Person({ notExists: ‘3vil’ })
  // throws “Field `notExists` is not in schema”
MONGOOSE V3
General Improvements

•Simplify schema declaration
•Hardened schema ‘strict’ option (throws)
•Removed MongooseNumber
MONGOOSE V3
General Improvements

•Simplify schema declaration
•Hardened schema ‘strict’ option (throws)
•Removed MongooseNumber
•Add multiple validators
MONGOOSE V3
General Improvements

•Simplify schema declaration
•Hardened schema ‘strict’ option (throws)
•Removed MongooseNumber
•Add multiple validators
•toObject,toJSON options
MONGOOSE V3
General Improvements

•Simplify schema declaration
•Hardened schema ‘strict’ option (throws)
•Removed MongooseNumber
•Add multiple validators
•toObject,toJSON options
•Specify a model in query.populate()
MONGOOSE V3
General Improvements

•Add document versioning




                           * soon!
MONGOOSE V3
General Improvements

•Add document versioning
•Recursive populate




                           * soon!
MONGOOSE V3
Documentation

•mongoosejs.com
•plugins.mongoosejs.com
•blog.mongoosejs.com
MONGOOSE V3
Support

•LearnBoost
MONGOOSE V3
Support

•LearnBoost
•10gen *
MONGOOSE V3
Support

•LearnBoost
•10gen * driver too
MONGOOSE V3

                 ¿Preguntas?
@aaronheckmann                   aaronheckmann@gmail.com
@10gen                         https://github.com/aheckmann
@learnboost       https://github.com/LearnBoost/mongoose
@mongodb
MONGOOSE V3

                 Thanks!
@aaronheckmann                  aaronheckmann@gmail.com
@10gen                        https://github.com/aheckmann
@learnboost      https://github.com/LearnBoost/mongoose
@mongodb

More Related Content

What's hot

Pre-Bootcamp introduction to Elixir
Pre-Bootcamp introduction to ElixirPre-Bootcamp introduction to Elixir
Pre-Bootcamp introduction to ElixirPaweł Dawczak
 
PHP tips and tricks
PHP tips and tricks PHP tips and tricks
PHP tips and tricks Damien Seguy
 
Document Classification In PHP
Document Classification In PHPDocument Classification In PHP
Document Classification In PHPIan Barber
 
Document Classification In PHP - Slight Return
Document Classification In PHP - Slight ReturnDocument Classification In PHP - Slight Return
Document Classification In PHP - Slight ReturnIan Barber
 
Dip Your Toes in the Sea of Security (PHP South Africa 2017)
Dip Your Toes in the Sea of Security (PHP South Africa 2017)Dip Your Toes in the Sea of Security (PHP South Africa 2017)
Dip Your Toes in the Sea of Security (PHP South Africa 2017)James Titcumb
 
Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...
Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...
Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...James Titcumb
 
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
Climbing the Abstract Syntax Tree (PHP South Africa 2017)Climbing the Abstract Syntax Tree (PHP South Africa 2017)
Climbing the Abstract Syntax Tree (PHP South Africa 2017)James Titcumb
 
R57shell
R57shellR57shell
R57shellady36
 
An Elephant of a Different Colour: Hack
An Elephant of a Different Colour: HackAn Elephant of a Different Colour: Hack
An Elephant of a Different Colour: HackVic Metcalfe
 
Slaying the Dragon: Implementing a Programming Language in Ruby
Slaying the Dragon: Implementing a Programming Language in RubySlaying the Dragon: Implementing a Programming Language in Ruby
Slaying the Dragon: Implementing a Programming Language in RubyJason Yeo Jie Shun
 
Taking Perl to Eleven with Higher-Order Functions
Taking Perl to Eleven with Higher-Order FunctionsTaking Perl to Eleven with Higher-Order Functions
Taking Perl to Eleven with Higher-Order FunctionsDavid Golden
 
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Masahiro Nagano
 
Why Hacking WordPress Search Isn't Some Big Scary Thing
Why Hacking WordPress Search Isn't Some Big Scary ThingWhy Hacking WordPress Search Isn't Some Big Scary Thing
Why Hacking WordPress Search Isn't Some Big Scary ThingChris Reynolds
 
Functional Pe(a)rls version 2
Functional Pe(a)rls version 2Functional Pe(a)rls version 2
Functional Pe(a)rls version 2osfameron
 
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기Suyeol Jeon
 
RxSwift 시작하기
RxSwift 시작하기RxSwift 시작하기
RxSwift 시작하기Suyeol Jeon
 
Teaching Your Machine To Find Fraudsters
Teaching Your Machine To Find FraudstersTeaching Your Machine To Find Fraudsters
Teaching Your Machine To Find FraudstersIan Barber
 
Top 10 php classic traps confoo
Top 10 php classic traps confooTop 10 php classic traps confoo
Top 10 php classic traps confooDamien Seguy
 

What's hot (20)

Pre-Bootcamp introduction to Elixir
Pre-Bootcamp introduction to ElixirPre-Bootcamp introduction to Elixir
Pre-Bootcamp introduction to Elixir
 
PHP tips and tricks
PHP tips and tricks PHP tips and tricks
PHP tips and tricks
 
Document Classification In PHP
Document Classification In PHPDocument Classification In PHP
Document Classification In PHP
 
Document Classification In PHP - Slight Return
Document Classification In PHP - Slight ReturnDocument Classification In PHP - Slight Return
Document Classification In PHP - Slight Return
 
PHP and MySQL
PHP and MySQLPHP and MySQL
PHP and MySQL
 
Dip Your Toes in the Sea of Security (PHP South Africa 2017)
Dip Your Toes in the Sea of Security (PHP South Africa 2017)Dip Your Toes in the Sea of Security (PHP South Africa 2017)
Dip Your Toes in the Sea of Security (PHP South Africa 2017)
 
Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...
Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...
Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...
 
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
Climbing the Abstract Syntax Tree (PHP South Africa 2017)Climbing the Abstract Syntax Tree (PHP South Africa 2017)
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
 
R57shell
R57shellR57shell
R57shell
 
An Elephant of a Different Colour: Hack
An Elephant of a Different Colour: HackAn Elephant of a Different Colour: Hack
An Elephant of a Different Colour: Hack
 
Slaying the Dragon: Implementing a Programming Language in Ruby
Slaying the Dragon: Implementing a Programming Language in RubySlaying the Dragon: Implementing a Programming Language in Ruby
Slaying the Dragon: Implementing a Programming Language in Ruby
 
Taking Perl to Eleven with Higher-Order Functions
Taking Perl to Eleven with Higher-Order FunctionsTaking Perl to Eleven with Higher-Order Functions
Taking Perl to Eleven with Higher-Order Functions
 
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
 
Why Hacking WordPress Search Isn't Some Big Scary Thing
Why Hacking WordPress Search Isn't Some Big Scary ThingWhy Hacking WordPress Search Isn't Some Big Scary Thing
Why Hacking WordPress Search Isn't Some Big Scary Thing
 
PHP Tutorial (funtion)
PHP Tutorial (funtion)PHP Tutorial (funtion)
PHP Tutorial (funtion)
 
Functional Pe(a)rls version 2
Functional Pe(a)rls version 2Functional Pe(a)rls version 2
Functional Pe(a)rls version 2
 
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
 
RxSwift 시작하기
RxSwift 시작하기RxSwift 시작하기
RxSwift 시작하기
 
Teaching Your Machine To Find Fraudsters
Teaching Your Machine To Find FraudstersTeaching Your Machine To Find Fraudsters
Teaching Your Machine To Find Fraudsters
 
Top 10 php classic traps confoo
Top 10 php classic traps confooTop 10 php classic traps confoo
Top 10 php classic traps confoo
 

Viewers also liked

Sharding
ShardingSharding
ShardingMongoDB
 
MongoFr : MongoDB as a log Collector
MongoFr : MongoDB as a log CollectorMongoFr : MongoDB as a log Collector
MongoFr : MongoDB as a log CollectorPierre Baillet
 
MongoDB Basic Concepts
MongoDB Basic ConceptsMongoDB Basic Concepts
MongoDB Basic ConceptsMongoDB
 
Scalable Event Analytics with MongoDB & Ruby on Rails
Scalable Event Analytics with MongoDB & Ruby on RailsScalable Event Analytics with MongoDB & Ruby on Rails
Scalable Event Analytics with MongoDB & Ruby on RailsJared Rosoff
 
MongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkMongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkChris Westin
 
Mongo Web Apps: OSCON 2011
Mongo Web Apps: OSCON 2011Mongo Web Apps: OSCON 2011
Mongo Web Apps: OSCON 2011rogerbodamer
 
Building a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and BeyondBuilding a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and BeyondSpike Brehm
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasminePaulo Ragonha
 
Node-IL Meetup 12/2
Node-IL Meetup 12/2Node-IL Meetup 12/2
Node-IL Meetup 12/2Ynon Perek
 
Nodejs mongoose
Nodejs mongooseNodejs mongoose
Nodejs mongooseFin Chen
 
Mongoose getting started-Mongo Db with Node js
Mongoose getting started-Mongo Db with Node jsMongoose getting started-Mongo Db with Node js
Mongoose getting started-Mongo Db with Node jsPallavi Srivastava
 
IBM MQ - better application performance
IBM MQ - better application performanceIBM MQ - better application performance
IBM MQ - better application performanceMarkTaylorIBM
 
Getting Started With MongoDB and Mongoose
Getting Started With MongoDB and MongooseGetting Started With MongoDB and Mongoose
Getting Started With MongoDB and MongooseYnon Perek
 
Javascript framework and backbone
Javascript framework and backboneJavascript framework and backbone
Javascript framework and backboneDaniel Lv
 
Document validation in MongoDB 3.2
Document validation in MongoDB 3.2Document validation in MongoDB 3.2
Document validation in MongoDB 3.2Andrew Morgan
 
영속성 컨텍스트로 보는 JPA
영속성 컨텍스트로 보는 JPA영속성 컨텍스트로 보는 JPA
영속성 컨텍스트로 보는 JPA경원 이
 
Becoming Node.js ninja on Cloud Foundry
Becoming Node.js ninja on Cloud FoundryBecoming Node.js ninja on Cloud Foundry
Becoming Node.js ninja on Cloud FoundryRaja Rao DV
 

Viewers also liked (20)

Sharding
ShardingSharding
Sharding
 
MongoFr : MongoDB as a log Collector
MongoFr : MongoDB as a log CollectorMongoFr : MongoDB as a log Collector
MongoFr : MongoDB as a log Collector
 
MongoDB Basic Concepts
MongoDB Basic ConceptsMongoDB Basic Concepts
MongoDB Basic Concepts
 
Scalable Event Analytics with MongoDB & Ruby on Rails
Scalable Event Analytics with MongoDB & Ruby on RailsScalable Event Analytics with MongoDB & Ruby on Rails
Scalable Event Analytics with MongoDB & Ruby on Rails
 
MongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkMongoDB's New Aggregation framework
MongoDB's New Aggregation framework
 
Mongo Web Apps: OSCON 2011
Mongo Web Apps: OSCON 2011Mongo Web Apps: OSCON 2011
Mongo Web Apps: OSCON 2011
 
Grid FS
Grid FSGrid FS
Grid FS
 
Building a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and BeyondBuilding a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and Beyond
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
 
Node-IL Meetup 12/2
Node-IL Meetup 12/2Node-IL Meetup 12/2
Node-IL Meetup 12/2
 
Nodejs mongoose
Nodejs mongooseNodejs mongoose
Nodejs mongoose
 
Mongoose getting started-Mongo Db with Node js
Mongoose getting started-Mongo Db with Node jsMongoose getting started-Mongo Db with Node js
Mongoose getting started-Mongo Db with Node js
 
IBM MQ - better application performance
IBM MQ - better application performanceIBM MQ - better application performance
IBM MQ - better application performance
 
Getting Started With MongoDB and Mongoose
Getting Started With MongoDB and MongooseGetting Started With MongoDB and Mongoose
Getting Started With MongoDB and Mongoose
 
Express JS
Express JSExpress JS
Express JS
 
Javascript framework and backbone
Javascript framework and backboneJavascript framework and backbone
Javascript framework and backbone
 
The SPDY Protocol
The SPDY ProtocolThe SPDY Protocol
The SPDY Protocol
 
Document validation in MongoDB 3.2
Document validation in MongoDB 3.2Document validation in MongoDB 3.2
Document validation in MongoDB 3.2
 
영속성 컨텍스트로 보는 JPA
영속성 컨텍스트로 보는 JPA영속성 컨텍스트로 보는 JPA
영속성 컨텍스트로 보는 JPA
 
Becoming Node.js ninja on Cloud Foundry
Becoming Node.js ninja on Cloud FoundryBecoming Node.js ninja on Cloud Foundry
Becoming Node.js ninja on Cloud Foundry
 

Similar to Mongoose v3 :: The Future is Bright

Laziness in Swift
Laziness in Swift Laziness in Swift
Laziness in Swift SwiftWro
 
Parsing with Perl6 Grammars
Parsing with Perl6 GrammarsParsing with Perl6 Grammars
Parsing with Perl6 Grammarsabrummett
 
Modern Getopt for Command Line Processing in Perl
Modern Getopt for Command Line Processing in PerlModern Getopt for Command Line Processing in Perl
Modern Getopt for Command Line Processing in PerlNova Patch
 
Crafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::ExporterCrafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::ExporterRicardo Signes
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with ClojureDmitry Buzdin
 
Introdução ao Perl 6
Introdução ao Perl 6Introdução ao Perl 6
Introdução ao Perl 6garux
 
Ruby closures, how are they possible?
Ruby closures, how are they possible?Ruby closures, how are they possible?
Ruby closures, how are they possible?Carlos Alonso Pérez
 
Php tips-and-tricks4128
Php tips-and-tricks4128Php tips-and-tricks4128
Php tips-and-tricks4128PrinceGuru MS
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Kang-min Liu
 
PHP and MySQL Tips and tricks, DC 2007
PHP and MySQL Tips and tricks, DC 2007PHP and MySQL Tips and tricks, DC 2007
PHP and MySQL Tips and tricks, DC 2007Damien Seguy
 
Code as data as code.
Code as data as code.Code as data as code.
Code as data as code.Mike Fogus
 
Php Code Audits (PHP UK 2010)
Php Code Audits (PHP UK 2010)Php Code Audits (PHP UK 2010)
Php Code Audits (PHP UK 2010)Damien Seguy
 
Writing Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::CmdWriting Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::CmdRicardo Signes
 
Ruby Language - A quick tour
Ruby Language - A quick tourRuby Language - A quick tour
Ruby Language - A quick touraztack
 

Similar to Mongoose v3 :: The Future is Bright (20)

Perl 6 by example
Perl 6 by examplePerl 6 by example
Perl 6 by example
 
Laziness in Swift
Laziness in Swift Laziness in Swift
Laziness in Swift
 
Parsing with Perl6 Grammars
Parsing with Perl6 GrammarsParsing with Perl6 Grammars
Parsing with Perl6 Grammars
 
Modern Getopt for Command Line Processing in Perl
Modern Getopt for Command Line Processing in PerlModern Getopt for Command Line Processing in Perl
Modern Getopt for Command Line Processing in Perl
 
Groovy
GroovyGroovy
Groovy
 
Ns2programs
Ns2programsNs2programs
Ns2programs
 
Crafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::ExporterCrafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::Exporter
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
Introdução ao Perl 6
Introdução ao Perl 6Introdução ao Perl 6
Introdução ao Perl 6
 
Ruby closures, how are they possible?
Ruby closures, how are they possible?Ruby closures, how are they possible?
Ruby closures, how are they possible?
 
Php tips-and-tricks4128
Php tips-and-tricks4128Php tips-and-tricks4128
Php tips-and-tricks4128
 
Rust ⇋ JavaScript
Rust ⇋ JavaScriptRust ⇋ JavaScript
Rust ⇋ JavaScript
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)
 
PHP and MySQL Tips and tricks, DC 2007
PHP and MySQL Tips and tricks, DC 2007PHP and MySQL Tips and tricks, DC 2007
PHP and MySQL Tips and tricks, DC 2007
 
Modern Perl
Modern PerlModern Perl
Modern Perl
 
Code as data as code.
Code as data as code.Code as data as code.
Code as data as code.
 
Php Code Audits (PHP UK 2010)
Php Code Audits (PHP UK 2010)Php Code Audits (PHP UK 2010)
Php Code Audits (PHP UK 2010)
 
Writing Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::CmdWriting Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::Cmd
 
PerlTesting
PerlTestingPerlTesting
PerlTesting
 
Ruby Language - A quick tour
Ruby Language - A quick tourRuby Language - A quick tour
Ruby Language - A quick tour
 

Recently uploaded

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

Mongoose v3 :: The Future is Bright

  • 1. MONGOOSE V3 Looking ahead jsconf.ar 2012 @aaronheckmann
  • 2.
  • 3.
  • 4.
  • 9. MONGOOSE V3 •What’s wrong •The Fix •Improvements •Support
  • 10. MONGOOSE V3 The Future Is Bright
  • 12. MONGOOSE V3 Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those! -- Tim Peters, The Zen of Python http://www.python.org/dev/peps/pep-0020/
  • 13. MONGOOSE V3 Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. There should be one-- Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. and preferably only one Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those! -- Tim Peters, The Zen of Python http://www.python.org/dev/peps/pep-0020/
  • 15. MONGOOSE V3 One way User.where(‘age’).$gt(17).select(‘name’).exec(cb) User.where(‘age’).gt(17).select({‘name’: 1}).exec(cb) User.where(‘age’).gt(17).select(‘name’, 1).run(cb) User.find({ age: { $gt: 17 }}).select([‘name’]).exec(cb) User.find({ age: { $gt: 17 }}, [‘name’]).run(cb)
  • 16. MONGOOSE V3 One way User.where(‘age’).$gt(17).select(‘name’).exec(cb) User.where(‘age’).gt(17).select({‘name’: 1}).exec(cb) User.where(‘age’).gt(17).select(‘name’, 1).run(cb) User.find({ age: { $gt: 17 }}).select([‘name’]).exec(cb) User.find({ age: { $gt: 17 }}, [‘name’]).run(cb)
  • 17. MONGOOSE V3 One way User.where(‘age’).$gt(17).select(‘name’).exec(cb) User.where(‘age’).gt(17).select({‘name’: 1}).exec(cb) User.where(‘age’).gt(17).select(‘name’, 1).run(cb) User.find({ age: { $gt: 17 }}).select([‘name’]).exec(cb) User.find({ age: { $gt: 17 }}, [‘name’]).run(cb)
  • 18. MONGOOSE V3 One way User.where(‘age’).$gt(17).select(‘name’).exec(cb) User.where(‘age’).gt(17).select({‘name’: 1}).exec(cb) User.where(‘age’).gt(17).select(‘name’, 1).run(cb) User.find({ age: { $gt: 17 }}).select([‘name’]).exec(cb) User.find({ age: { $gt: 17 }}, [‘name’]).run(cb)
  • 19. MONGOOSE V3 One way User.where(‘age’).$gt(17).select(‘name’).exec(cb) User.where(‘age’).gt(17).select({‘name’: 1}).exec(cb) User.where(‘age’).gt(17).select(‘name’, 1).run(cb) User.find({ age: { $gt: 17 }}).select([‘name’]).exec(cb) User.find({ age: { $gt: 17 }}, [‘name’]).run(cb)
  • 21. MONGOOSE V3 API pollution Query methods $or -> or $in -> in $near -> near $nor -> nor $nin -> nin $within -> within $gt -> gt $all -> all $box -> box $gte -> gte $regex ->regex $center - > center $lt -> lt $size -> size $centerSphere -> centerSphere $lte -> lte $slice -> slice $maxDistance ->maxDistance
  • 22. MONGOOSE V3 API pollution Query methods $ne -> ne only -> select({ path: 1 }) $mod -> mod exclude -> select({ path: 0 }) $exists -> exists run -> exec $elemMatch -> elemMatch notEqualTo -> ne asc -> sort({ path: 1 }) wherein -> within desc -> sort({ path: 0}) fields -> select
  • 23. MONGOOSE V3 API pollution Connection methods createConnection createSetConnection connect connectSet
  • 24. MONGOOSE V3 The Fix? createConnection $nin -> nin $ne -> ne createSetConnection $all -> all $mod -> mod connect $regex -> regex $exists -> exists connectSet $size -> size $elemMatch -> elemMatch $or -> or $slice -> slice asc -> sort({ path: 1 }) $nor -> nor $near -> near desc -> sort({ path: 0}) $gt -> gt $within -> within only -> select({ path: 1 }) $gte -> gte $box -> box exclude -> select({ path: 0 }) $lt -> lt $center -> center run -> exec $lte -> lte $centerSphere -> centerSphere notEqualTo -> ne $in -> in $maxDistance -> maxDistance wherein -> within fields -> select
  • 25. MONGOOSE V3 The Fix kill all the things createConnection $nin -> nin $ne -> ne createSetConnection $all -> all $mod -> mod connect $regex -> regex $exists -> exists connectSet $size -> size $elemMatch -> elemMatch $or -> or $slice -> slice asc -> sort({ path: 1 }) $nor -> nor $near -> near desc -> sort({ path: 0}) $gt -> gt $within -> within only -> select({ path: 1 }) $gte -> gte $box -> box exclude -> select({ path: 0 }) $lt -> lt $center -> center run -> exec $lte -> lte $centerSphere -> centerSphere notEqualTo -> ne $in -> in $maxDistance -> maxDistance wherein -> within fields -> select
  • 26. MONGOOSE V3 The Fix kill all the things createConnection $nin -> nin $ne -> ne createSetConnection $all -> all $mod -> mod connect $regex -> regex $exists -> exists connectSet $size -> size $elemMatch -> elemMatch $or -> or $slice -> slice asc -> sort({ path: 1 }) $nor -> nor $near -> near desc -> sort({ path: 0}) $gt -> gt $within -> within only -> select({ path: 1 }) $gte -> gte $box -> box exclude -> select({ path: 0 }) $lt -> lt $center -> center run -> exec $lte -> lte $centerSphere -> centerSphere notEqualTo -> ne $in -> in $maxDistance -> maxDistance wherein -> within fields -> select http://soundbible.com/1575-High-Definition-Machine-Gun.html http://openclipart.org/detail/20561/set-of-bullet-holes-by-rg1024
  • 27. MONGOOSE V3 The Fix remove query aliases Coffee.where(‘flavor’).$in(array).run()
  • 28. MONGOOSE V3 The Fix remove query aliases Coffee.where(‘flavor’).$in(array).run() Coffee.where(‘flavor’).in(array).exec()
  • 29. MONGOOSE V3 The Fix remove query aliases Coffee.where(‘flavor’).$in(array).run() Coffee.where(‘flavor’).in(array).exec()
  • 30. MONGOOSE V3 The Fix remove query aliases Coffee.find().asc(‘flavor’).run()
  • 31. MONGOOSE V3 The Fix remove query aliases Coffee.find().asc(‘flavor’).run() Coffee.find().sort(‘flavor’).exec()
  • 32. MONGOOSE V3 The Fix remove query aliases Coffee.find().asc(‘flavor’).run() Coffee.find().sort(‘flavor’).exec()
  • 33. MONGOOSE V3 The Fix Combine connection methods goose.createSetConnection(connString)
  • 34. MONGOOSE V3 The Fix Combine connection methods goose.createSetConnection(connString) goose.createConnection(connString)
  • 35. MONGOOSE V3 The Fix Combine connection methods mongoose.connectSet(connString)
  • 36. MONGOOSE V3 The Fix Combine connection methods mongoose.connectSet(connString) mongoose.connect(connString)
  • 38. MONGOOSE V3 What’s Wrong? Query method arguments
  • 39. MONGOOSE V3 What’s Wrong? Query method arguments query.select(array) query.select(‘path’, 1, ‘path’, 1) query.select({ key: 0 }) query.select(‘space delimited’) query.hint(‘path’, 1, ‘path’, 1) query.hint({ key: 1})
  • 40. MONGOOSE V3 What’s Wrong? Query method arguments query.select(array) query.select(‘path’, 1, ‘path’, 1) query.select({ key: 0 }) query.select(‘space delimited’) query.hint(‘path’, 1, ‘path’, 1) query.hint({ key: 1})
  • 41. MONGOOSE V3 The Fix Query method arguments query.select(‘include -exclude’)
  • 42. MONGOOSE V3 The Fix Query method arguments query.select(‘include -exclude’) query.select({ include: 1, exclude: 0 })
  • 43. MONGOOSE V3 The Fix Query method arguments query.select({ include: 1, exclude: 0 }) query.select(‘include -exclude’) query.sort({ include: 1, exclude: 0 }) query.sort(‘include -exclude’)
  • 47. MONGOOSE V3 Missing MongoDB features •Map Reduce
  • 48. MONGOOSE V3 Missing MongoDB features •Map Reduce var o = { map: mapFn, reduce: rFn } Talks.mapReduce(o, function (err, res) { console.log(res) })
  • 49. MONGOOSE V3 Missing MongoDB features •Map Reduce var o = { map: mapFn, reduce: rFn } o.out = { replace: ‘mapped_talks’ } Talks.mapReduce(o, function (err, res) { res.find().where().exec(function (err, docs) { console.log(res) }) })
  • 50. MONGOOSE V3 Missing MongoDB features •FindAndModify
  • 51. MONGOOSE V3 Missing MongoDB features •FindAndModify // old way var o = { _id: anObjectId } Talks.findOne(o, function (err, doc) { doc.name = ‘peanut butter’; doc.save() })
  • 52. MONGOOSE V3 Missing MongoDB features •FindAndModify // new way var o = { _id: anObjectId } , up = { $set: { name: ‘peanut butter’}} Talks.findOneAndUpdate(o, up, function (err, doc) { console.log(doc) })
  • 53. MONGOOSE V3 Missing MongoDB features •FindAndModify var o = { name: ‘peanut butter’ } Talks.findOneAndRemove(o, function (err, res) { console.log(res) })
  • 54. MONGOOSE V3 Missing MongoDB features •FindAndModify Talks.findByIdAndUpdate(id, update, cb) Talks.findByIdAndRemove(id, update, cb)
  • 55. MONGOOSE V3 Missing MongoDB features •Map Reduce •FindAndModify •Capped collections * * soon!
  • 56. MONGOOSE V3 Missing MongoDB features •Map Reduce •FindAndModify •Capped collections * •Aggregation * * soon!
  • 57. MONGOOSE V3 Missing MongoDB features •Aggregation Article.aggregate( { $project : { author : 1, tags : 1 }} , { $unwind : "$tags" } , { $group : { _id : { tags : 1 } , authors : { $addToSet : "$author" } } }); * soon!
  • 58. MONGOOSE V3 Missing MongoDB features •Aggregation Article.aggregate( { $project : { author : 1, tags : 1 }} , { $unwind : "$tags" } , { $group : { _id : { tags : 1 } , authors : { $addToSet : "$author" } } }); * soon!
  • 59. MONGOOSE V3 Missing MongoDB features •Aggregation Article.aggregate( { $project : { author : 1, tags : 1 }} , { $unwind : "$tags" } , { $group : { _id : { tags : 1 } , authors : { $addToSet : "$author" } } }); * soon!
  • 60. MONGOOSE V3 Missing MongoDB features •Aggregation Article.aggregate( { $project : { author : 1, tags : 1 }} , { $unwind : "$tags" } , { $group : { _id : { tags : 1 } , authors : { $addToSet : "$author" } } }); * soon!
  • 61. MONGOOSE V3 Missing MongoDB features •Aggregation Article.aggregate( { $project : { author : 1, tags : 1 }} , { $unwind : "$tags" } , { $group : { _id : { tags : 1 } , authors : { $addToSet : "$author" } } }); * soon!
  • 62. MONGOOSE V3 Missing MongoDB features •Aggregation Article.aggregate( { $project : { author : 1, tags : 1 }} , { $unwind : "$tags" } , { $group : { _id : { tags : 1 } , authors : { $addToSet : "$author" } } }); * soon!
  • 63. MONGOOSE V3 Missing MongoDB features •Map Reduce •FindAndModify •Capped collections * •Aggregation * •Improved geo-spatial support * * soon!
  • 66. MONGOOSE V3 Performance •lean queries Talks .findOne() .exec(function (err, doc) { // doc.save() })
  • 67. MONGOOSE V3 Performance •lean queries Talks .findOne() .setOptions({ lean: true }) .exec(function (err, doc) { // doc.save })
  • 68. MONGOOSE V3 Performance •lean queries Talks .findOne() .setOptions({ lean: true }) .exec(function (err, doc) { // doc.save -> undefined })
  • 70. MONGOOSE V3 Performance •lean queries •background indexes •connection pool size?
  • 71. MONGOOSE V3 Performance •lean queries •background indexes •connection pool size? •memory usage?
  • 73. MONGOOSE V3 General Improvements •Improved update command generation for arrays
  • 74. MONGOOSE V3 General Improvements •Improved update command generation for arrays var schema = new Schema({ tags: [], name: String })
  • 75. MONGOOSE V3 General Improvements •Improved update command generation for arrays var schema = new Schema({ tags: [], name: String }) var Talks = db.model(‘Talk’, schema)
  • 76. MONGOOSE V3 General Improvements •Improved update command generation for arrays var schema = new Schema({ tags: [], name: String }) var Talks = db.model(‘Talk’, schema) Talks.findById(id, function (err, talk) { talk.name = ‘peanut butter’ talk.tags.push(‘nerdcore’) talk.save(callback) })
  • 77. MONGOOSE V3 General Improvements •Improved update command generation for arrays var schema = new Schema({ tags: [], name: String }) var Talks = db.model(‘Talk’, schema) Talks.findById(id, function (err, talk) { talk.name = ‘peanut butter’ talk.tags.push(‘nerdcore’) talk.save(callback) // magic! })
  • 78. MONGOOSE V3 General Improvements •Improved update command generation for arrays Object.defineProperty(talk, ‘name’, { get: function () { return this.smth } , set: function (v){ this.smth = v } })
  • 79. MONGOOSE V3 General Improvements •Improved update command generation for arrays Object.defineProperty(talk, ‘name’, { get: function () { return this.smth } , set: function (v){ record(‘name’); this.smth = v } })
  • 80. MONGOOSE V3 General Improvements •Improved update command generation for arrays Object.defineProperty(talk, ‘name’, { get: function () { return this.smth } , set: function (v){ this._set = {} this._set[‘name’] = v this.smth = v } })
  • 81. MONGOOSE V3 General Improvements •Improved update command generation for arrays talk.save() -> var update = {}; update.$set = talk._set; Talks.update({ _id: talk._id }, update, callback)
  • 82. MONGOOSE V3 General Improvements •Improved update command generation for arrays talk.tags.push = function () { record(‘push’, arguments) }
  • 83. MONGOOSE V3 General Improvements •Improved update command generation for arrays talk.tags.push = function () { record(‘push’, arguments) } talk.save() -> var update = {}; update.$pushAll = { tags: args } Talk.update({_id:talk._id}, update, callback)
  • 84. MONGOOSE V3 General Improvements •Improved update command generation for arrays talk.tags.push(‘nerdcore’) talk.tags.remove(‘php’) talk.save(callback) // fail!
  • 85. MONGOOSE V3 General Improvements •Improved update command generation for arrays talk.tags.push(‘nerdcore’) talk.tags.remove(‘php’) talk.save(callback) // success!!
  • 87. MONGOOSE V3 General Improvements •Simplify schema declaration var personSchema = new Schema({ name: String , val: Number , buffer: Buffer , array: Array , etc: ... })
  • 88. MONGOOSE V3 General Improvements •Simplify schema declaration var personSchema = new Schema({ name: ‘string’ , val: ‘number’ , buffer: ‘buffer’ , array: ‘array’ , etc: ... })
  • 89. MONGOOSE V3 General Improvements •Hardened schema ‘strict’ option var personSchema = new Schema({ name: ‘string’ , val: ‘number’ , buffer: ‘buffer’ , array: ‘array’ , etc: ... }, { strict: true })
  • 90. MONGOOSE V3 General Improvements •Hardened schema ‘strict’ option var personSchema = new Schema({ name: ‘string’ , val: ‘number’ , buffer: ‘buffer’ , array: ‘array’ , etc: ... }, { strict: ‘throw’ })
  • 91. MONGOOSE V3 General Improvements •Hardened schema ‘strict’ option new Person({ notExists: ‘3vil’ })
  • 92. MONGOOSE V3 General Improvements •Hardened schema ‘strict’ option new Person({ notExists: ‘3vil’ }) // throws “Field `notExists` is not in schema”
  • 93. MONGOOSE V3 General Improvements •Simplify schema declaration •Hardened schema ‘strict’ option (throws) •Removed MongooseNumber
  • 94. MONGOOSE V3 General Improvements •Simplify schema declaration •Hardened schema ‘strict’ option (throws) •Removed MongooseNumber •Add multiple validators
  • 95. MONGOOSE V3 General Improvements •Simplify schema declaration •Hardened schema ‘strict’ option (throws) •Removed MongooseNumber •Add multiple validators •toObject,toJSON options
  • 96. MONGOOSE V3 General Improvements •Simplify schema declaration •Hardened schema ‘strict’ option (throws) •Removed MongooseNumber •Add multiple validators •toObject,toJSON options •Specify a model in query.populate()
  • 97. MONGOOSE V3 General Improvements •Add document versioning * soon!
  • 98. MONGOOSE V3 General Improvements •Add document versioning •Recursive populate * soon!
  • 103. MONGOOSE V3 ¿Preguntas? @aaronheckmann aaronheckmann@gmail.com @10gen https://github.com/aheckmann @learnboost https://github.com/LearnBoost/mongoose @mongodb
  • 104. MONGOOSE V3 Thanks! @aaronheckmann aaronheckmann@gmail.com @10gen https://github.com/aheckmann @learnboost https://github.com/LearnBoost/mongoose @mongodb

Editor's Notes

  1. \n
  2. MongoDB is an open source, document-oriented database.\nInstead of storing your data in tables and rows as you would with a relational database, MongoDB lets you store JSON-like documents. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. falls flat on its face\n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. Argentina you eat the whole cow.\nWe want the whole MongoDB cow.\n
  50. Argentina you eat the whole cow.\nWe want the whole MongoDB cow.\n
  51. \n
  52. return results\n
  53. return a model instance\n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. circular buffer\nTTL collections\n
  60. MongoDB 2.2\n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. query.stream()\n
  72. \n
  73. \n
  74. \n
  75. no idea what needs to be done\n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n
  87. \n
  88. 2 approaches - hit db with two operations or just one\n
  89. \n
  90. \n
  91. \n
  92. storing schemas as json\n
  93. \n
  94. \n
  95. \n
  96. \n
  97. \n
  98. \n
  99. \n
  100. \n
  101. \n
  102. \n
  103. \n
  104. \n
  105. \n
  106. Last slide, the future of Mongoose is Bright\n
  107. \n
  108. \n