These are chat archives for Automattic/mongoose

19th
Feb 2016
James Lee
@uptownhr
Feb 19 2016 00:30
@vkarpov15 https://gist.github.com/uptownhr/5b9e6d3f3b64c59a54bf is possible to define array subdocuments as defaults? So when a new document is instantiated, you can define, I want two subdocuments to be created by default
James Lee
@uptownhr
Feb 19 2016 00:40
@vkarpov15 i have some examples of cases I have questions about in the bottom of the teams: definition
antonioaltamura
@antonioaltamura
Feb 19 2016 13:27
guys could you provide an aggregate $lookup example, I'm finding difficult to use it in mongoose
Chris Paradeise
@cparadeise
Feb 19 2016 14:20
db.collection1.aggregate({ $lookup: { from: 'collection2', localField: 'someIDonColl1', foreignField: 'someIDonColl2', as: 'whatyou_want_your_new_coll_to_be_called' }} )
@alfredopacino Provided you have the Mongo version that supports this
antonioaltamura
@antonioaltamura
Feb 19 2016 14:29
uhm yeah maybe it was a version issue, the command db.version() returns "3.2.1"
but in my application I have "mongodb": "^2.1.6" as dependency. Should I update?
J
@jhyland87
Feb 19 2016 15:50
Anyone here think the Mongoose for Application Development book might be outdated? I wanted to get a physical book to read when im on a road trip, specifically for Mongoose. This one was published in 2013 though
J
@jhyland87
Feb 19 2016 15:55
Ah, nvm, the book covers version 3.6.x, thats a major release outdated
Thats the problem with programming language books >.< And IT books in general really
Alexander Grasley
@agrasley
Feb 19 2016 20:54
Hi, just getting started with mongoose. I tried to find this in the docs but I couldn't. Are schemas composable? If I have a large object tree with several nested objects, do I have to make that all one schema or can I break the nested objects into their own schemas and then compose them all? Thanks.
James Lee
@uptownhr
Feb 19 2016 23:42
@agrasley lookup subdocuments