[00:22:03] <bryon> hello mongo mavens! quick question: when doing an update operation with upsert:true, does it matter whether the word upsert is quotes?
[00:23:28] <bryon> or, is { upsert : true } the same as { 'upsert' : true } ?
[00:24:57] <Boomtime> @bryon: it's the same thing - technically, with quotes is correct JSON, the first form (without quotes) is supported by many parsers but not technically correct
[11:31:20] <khrm> Now some 100 people address change.
[11:31:38] <khrm> We send an id and new address. Can this be done in a single query?
[11:32:17] <khrm> Here I have taken address but we could have let's say hierarchy. In that case I want either all pass or all fail.
[11:32:26] <jost> Hi! I'm using spring data, and want to copy a collection. How can I do that? I can execute arbitrary BSON commands, but cannot find any resources on how to construct a BSON document to copy a collection
[11:32:30] <khrm> Is this kind of transaction possible in mongodb?
[11:45:07] <StephenLynx> oh, I didnt read that much from his question :v
[11:45:23] <StephenLynx> I just read some and though "oh, multiple documents with different values for each"
[11:47:21] <ams_> I'd quite like to have the ability to "mark" a collection for backup and then have a script run mongodump and only back up those collections. Is that feasible?
[11:57:25] <acedude> part that's giving me most trouble is "date_trunc('day', created_at) as date", I've been googling for quite some time without any good results
[12:03:53] <Derick> m3t4lukas: most mongodb-ers here work on drivers
[12:04:11] <acedude> kick ass, I'll have a read, thanks again Derick!
[12:04:21] <StephenLynx> I work on chinese cartoon websites :v
[12:05:27] <m3t4lukas> Derick: what about GothAlice, joannac and ranman? I never see them write anything :P I ran into a bit of a problem extending mongod with a new accumulator.
[12:06:27] <cheeser> only one of those work for mongodb
[12:06:45] <StephenLynx> from what I seen GothAlice doesn't work on mongo nor on drivers, but is an extreme power user and IMO, knows more about it than many driver developers.
[12:11:35] <m3t4lukas> the family sticks together in IRC ;)
[12:56:44] <jost> Where is the documentation for the server side javascripts? Especially which objects exist, and what their properties are? E.g. what the db-object does?
[13:14:57] <warriorkitty> Where to put the callback?
[13:15:00] <GothAlice> m3t4lukas: I tended to do things a few years before 10gen would figure out it was a good idea to put in core. Things like compression, full text indexing with stemming and Okapi BM-25 ranking, etc.
[13:16:19] <GothAlice> m3t4lukas: At this point I'm working on storing database schemas in the database to self-describe in a front-end editable way. Databaseception.
[13:17:09] <GothAlice> warriorkitty: AFIK there's a "go" method (probably not actually called that) to trigger the query to actually run and pass in a callback. Skip, limit, etc. just change values stored in the query before it's run.
[13:18:13] <warriorkitty> GothAlice: Thank you. I understand there must be some "go" function but I don't know how it's called. I've tried with "exec" already and that is not it.
[13:18:51] <GothAlice> Alas, I can do no more than you in terms of scouring documentation. I've never used Mongoose, and from all indications it's… painful to use.
[13:20:26] <warriorkitty> GothAlice: OK, thank you very much.
[13:34:29] <m3t4lukas> GothAlice: sounds like a lot of fun :)
[13:48:19] <acedude> Derick - I finally figured my query out, I'm still familiarizing with basic concepts, but I managed to achieve what I needed: http://pastebin.com/6dqPDeSE
[13:53:43] <Derick> cool, you're missing your WHERE clause though... make sure you put these in a $match before the $group
[14:16:16] <m3t4lukas> yeah, I wish I could go to mars one day and die there
[14:16:49] <Derick> ... i'd rather stay alive, come back, and tell everybody about it!
[14:17:11] <kablaaam> I have a mongodb instance in a docker container running and have the credentials ready but I want to translate them to URL form (I have an environment variable file with URL authentications). Ran without password with the command from here: https://github.com/tutumcloud/mongodb#run-mongodb-without-password
[14:23:13] <m3t4lukas> Derick: If you give me an electic motor cycle and some solar panels I'd willingly trade some extra time on mars for coming back and telling anyone about it :D
[17:44:26] <traph> if the mongodb keyfile is multi-line, instead of a one-liner, does it concatenate every individual line to compose the key?
[17:46:03] <traph> so if we have 3 lines, each on a new line, the string should be "line1line2line3", right?
[21:22:31] <msx> m3t4lukas: cheers. FYI: do you remember the strange issue I was having with Mongo hanging while importing some collections (from 2.6 mmap to 3.0.8 wiredTiger)? It turned out that the size (1GB) I assigned to the wiredTiger cache (/etc/mongod.conf) was too small so after increasing it to 2GB everything worked as expected.
[21:30:02] <ranman> hi I'm ranman I work at spacex
[21:48:47] <m3t4lukas> yeah ranman, does spacex use mongo, too?
[21:49:05] <m3t4lukas> if yes then mongo literally becomes rocket science :D
[21:51:56] <MacWinner> I'm having an interesting issue with the mongo node driver (i'm using the mongoose orm, however I think the problem is with connection pooling). Basically it looks like my node processes keep tearing down the connection pool and reconnecting them in the background.. throughout the day, I occasionality get a No Primary Server available even though the cluster is fine.. anyone seen this or have any tips? There is a ticket on github, and Christian from
[21:51:57] <MacWinner> mongodb says it can happen if all the connection pool threads are not utlized within the initial timeout, then all the pool threads will be torn down
[21:52:38] <MacWinner> has anyone experienced this connection pooling issue?
[22:05:05] <MacWinner> doh. I think this issue has been happening for a while, we just didn't notice it
[22:05:30] <MacWinner> now i'm pretty concerned since my mongodb log file is getting filled up like crazy with connect/disconnect/reconnect messages
[22:09:35] <evgeniuz> hi. can someone suggest what is considered best practice: store multiple small documents related using properties or store big nested document and use projections for requests?
[22:10:04] <GothAlice> cheeser: I think you meant "ugh, mongoose". :P
[22:10:11] <evgeniuz> logically big document is appealing, but I wonder what performance impact is
[22:11:43] <GothAlice> evgeniuz: Neither. Model your data the way you intend to consume it, with a mind that MongoDB can't do JOINs. Optimize query performance, and optimize the cases that count. (Since any form of optimization without measurement is by definition premature.) As one example, I have forums using MongoDB. The individual forums are in one collection, then there's a collection for threads.
[22:12:34] <GothAlice> In a relational model, I might have another table for replies to threads (storing only metadata about threads in the threads table), but in MongoDB since a) comments need to be deleted when the thread is deleted, and b) when viewing a reply to a thread, one needs the metadata anyway I instead store all replies embedded in the thread.
[22:13:23] <GothAlice> MongoDB lets me range query the list of embedded documents ($slice) and thus paginate easily, or omit the replies if all I want is the metadata (i.e. in the thread listing for a forum).
[22:13:24] <evgeniuz> but consider case when you want to get title and description for thread, but not huge replies section
[22:14:50] <evgeniuz> great, that's what I needed, thanks
[22:15:04] <GothAlice> But you'll note I don't go crazy and embed replies inside threads which are embedded in forums… that way lies madness. The general rule is to only go one level deep.
[22:16:17] <GothAlice> http://www.javaworld.com/article/2088406/enterprise-java/how-to-screw-up-your-mongodb-schema-design.html goes into some of the design considerations.
[22:17:31] <evgeniuz> there's basically user objects that can have multiple "nodes" and each "node" can have multiple properties (different ones)
[22:17:41] <evgeniuz> most of the time all nodes for users will be selected
[22:18:03] <evgeniuz> but sometimes (relatively rare) I need to select single node
[22:18:41] <GothAlice> Hmm; careful on that. You might think a model like {name: "foo", properties: {age: 27, gender: "robot"}} but you can't easily index and search truly "arbitrary user-supplied properties" like that.
[22:18:46] <evgeniuz> so I was wondering if storing user as single document (instead of multiple collections for user/node) is ok performance-wise
[22:19:16] <evgeniuz> I don't need to search properties, each node will have an id (index probably)
[22:19:38] <GothAlice> https://gist.github.com/amcgregor/aaf7e0f3266c68af20cd is a concrete example of bad and good approaches to arbitrary properties.
[22:20:52] <GothAlice> Yeah, if you avoid the need to query the arbitrary data, you save a lot of headaches. ;)