tohaganWhile I can see that space delimited fields in a query is nice an concise, I think it will limit your future features. e.g. How will you support functions in query in the future? What about nested subqueries? From where I'm standing (as a Mongoose newbie but an experienced SQL dev) stuffing all the field names inside a single text string appear to points to rather limited expressability in the future.4 months ago
Are you sure you want to
Justin Schier, Owner/Web Developer at Sonik NewmediaSuper excited about this! Honestly, my biggest frustration with Mongoose has always been that the documentation was about as sparse as you could possibly get. When you're writing up documentation for the new version, PLEASE PLEASE PLEASE try and think of various applications and cases for each part of the documentation, not just one canonical example like exists now. For example, even in your slide talking about new ways of sorting, you only showed the example for ascending, not descending - which I'm sure would take some kind of modifier. This is an obvious one, but I would just encourage the Mongoose people to put a little more effort into showing multiple examples - they never hurt, only help. Thanks so much for working on this wonderful software that I use every day! Justin Schier @justinschier1 year ago
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
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
falls flat on its face\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
Argentina you eat the whole cow.\nWe want the whole MongoDB cow.\n
Argentina you eat the whole cow.\nWe want the whole MongoDB cow.\n
\n
return results\n
return a model instance\n
\n
\n
\n
\n
\n
circular buffer\nTTL collections\n
MongoDB 2.2\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
query.stream()\n
\n
\n
\n
no idea what needs to be done\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
2 approaches - hit db with two operations or just one\n
MONGOOSE V3Beautiful 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 arent 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 youre Dutch.Now is better than never.Although never is often better than *right* now.If the implementation is hard to explain, its a bad idea.If the implementation is easy to explain, it may be a good idea.Namespaces are one honking great idea -- lets do more of those! -- Tim Peters, The Zen of Python http://www.python.org/dev/peps/pep-0020/
MONGOOSE V3Beautiful 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 arent special enough to break the rules.Although practicality beats purity. and preferably only oneErrors 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 youre Dutch.Now is better than never.Although never is often better than *right* now.If the implementation is hard to explain, its a bad idea.If the implementation is easy to explain, it may be a good idea.Namespaces are one honking great idea -- lets do more of those! -- Tim Peters, The Zen of Python http://www.python.org/dev/peps/pep-0020/
MONGOOSE V3Missing MongoDB features•FindAndModify // old way var o = { _id: anObjectId } Talks.findOne(o, function (err, doc) { doc.name = ‘peanut butter’; doc.save() })
MONGOOSE V3Missing 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 V3Missing MongoDB features•FindAndModify var o = { name: ‘peanut butter’ } Talks.findOneAndRemove(o, function (err, res) { console.log(res) })
1–3 of 3 previous next Post a comment