PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Sunday the 12th of April, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[04:38:13] <grill> Hi. how exactly would I go about updating a document's inner nested fields (e.g. "Title") when the document's structure is like this: http://pastebin.com/4dcJwt6S
[04:43:47] <dimon222> dot notation like in class structure
[04:44:39] <dimon222> for ex. for title - {"movies.tt0385752.Title":"TestTitle"}
[04:45:13] <grill> interesting
[12:08:57] <Shapeshifter> Hi. In my application I have two kinds of documents, A and B. Each A has a field referencing a B. When I search for A documents I need to pull in additional information on each A from a B. How can I avoid the n+1 problem in this case? Right now I do one query for finding all the A docs I need, but then for each A I execute another query to find the matching B, which of course is slow.
[20:35:38] <callumacrae> amazing, there really is a channel for everything
[20:35:40] <callumacrae> https://github.com/callumacrae/callum.reviews/blob/master/api/index.js#L40-L54
[20:35:43] <callumacrae> Is there a way to shorten this code?
[20:36:02] <callumacrae> it's incrementing the value for a date by one, unless it doesn't exist, where it is creating it and setting it to one
[20:36:20] <callumacrae> I'm guessing it isn't an uncommon pattern; any shorter ways to do it?
[20:37:42] <cheeser> an upsert probably
[20:38:02] <cheeser> if $inc doesn't work on a missing value, you can use $setOnInsert
[21:36:38] <callumacrae> cheeser: I forgot to say thanks. Thanks!
[21:36:42] <callumacrae> $inc works on a missing value
[21:44:59] <macwinner> hi.. i currently have mongo 2.6.9 installed on centos7 via yum repo which points to http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
[21:45:17] <macwinner> how do i upgrade to 3.0.2? yum upgrade doesn't seem to see the new version
[21:46:13] <macwinner> i see another repo for 3.0.. is it safe to setup that repo and remove the existing repo and then upgrade?
[22:06:52] <cheeser> callumacrae: good to hear. :)
[22:18:29] <dimon222> macwinner, you cant upgrade from 2.6.9 to 3.0, they're in different branches
[22:18:57] <dimon222> you can dump your bases and import them on next version of mongo, but there's no way to upgrade of mongo like that
[22:19:23] <dimon222> basicaly dump bases, uninstall mongo 2.6.9, add 3.x repo, install 3.x. import bases
[22:19:54] <macwinner> dimon222: are you sure? I thought you can do upgrade wihtout dump as long as you don't upgrade to wiredtiger
[22:20:24] <macwinner> i'll check docs again
[22:21:16] <_Atom_> anyone here read noSQL distilled
[22:22:53] <dimon222> macwinner, well, you can do upgrade of binaries manually. I wont suggest u to do upgrade through repo since it may lead to whatever
[22:23:22] <dimon222> either clean install for next revision 3.x. with repo, or upgrade binaries manually
[22:23:36] <dimon222> also whats the point of upgrading to 3.x without using wiredTiger tho?
[22:24:33] <macwinner> dimon222: lots of improvements on regular storage engine according some folks in the channel
[22:34:51] <dimon222> wiredTiger is like brazingly fast, so may not worth it to use mmap anymore
[22:35:38] <dimon222> and more stable, and etc