PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Sunday the 20th of October, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[02:35:05] <sontek> When I run the mongo client i'm getting segfault: http://paste2.org/BCFV1jy4
[02:35:24] <sontek> MongoDB shell version: 2.4.6
[02:51:18] <newbiez> what are the channel rules for posting questions
[02:52:21] <eph3meral> newbiez, probably the same as most IRC channels, don't ask to ask, just ask - don't use the enter key as punctuation - demonstrate you've tried to use google - give us a pastebin of the code at hand (don't paste in the channel)
[02:52:38] <eph3meral> be thorough but don't include so much detail our eyes gloss over
[03:08:54] <newbiez> lets say you have a query to fetch 350k document but you apply a limit of say 100 document that is to be sorted. Will sorting be applied to all 350k documents or will it be on the 100 document?
[03:09:24] <cheeser> sort is applied first, i believe
[03:14:12] <newbiez> lets say you have a query to fetch 350k document but you apply a limit of say 100 document that is to be sorted. Will sorting be applied to all 350k documents or will it be on the 100 document?
[03:17:04] <newbiez> I want to know if the 100 documents limited are sort or is it the 350,000 document.
[03:20:39] <cesarkaw_> newbiez: if you do it through the usual channels, the list is sorted first.
[03:20:43] <cesarkaw_> newbiez:
[03:21:46] <newbiez> yes, the usual channel as in the shell.
[03:24:24] <newbiez> so 100 documents is sort and not the 350k of documents
[03:24:44] <cesarkaw_> newbiez: no.
[03:24:59] <cesarkaw_> newbiez: the sort is applied first, then the output is limited.
[03:25:07] <newbiez> ok
[03:25:34] <eph3meral> cesarkaw_, hey, since you seem to be present and somewhat knowlegeable, perhaps you can translate this thing my friend said into the relevant feature/section of docs/google term for me?
[03:25:52] <eph3meral> cesarkaw_, "mongo is cool because one big thing is intellegent caching where you want to run through a stored object for addition querying"
[03:26:03] <eph3meral> think he meant additional
[03:26:35] <cesarkaw_> eph3meral: Sorry, I saw your question earlier, but I have no idea what it is about.
[03:26:47] <eph3meral> hah, ok thanks
[03:27:47] <eph3meral> cesarkaw_, I can probably describe a bit more this other system being considered: basically a cached query aggregator for a regular SQL database that pretty much just has some views that join like about 12 tables, and then we basically cache that view result set every 10 minutes or something I think
[03:28:48] <cesarkaw_> eph3meral: still no idea
[03:28:48] <eph3meral> and supposedly "several nosql solutions do this out of the box"... but I'm not sure how one would go about that except trying to just turn aggregate query results into collections
[03:29:29] <eph3meral> cesarkaw_, I think the idea being, we may store data differently than we output it, is there a a way to do anything similar to what "views" do in regular sql?
[03:29:44] <cesarkaw_> eph3meral: in Mongo?
[03:29:54] <eph3meral> yep, in mongo
[03:30:41] <cesarkaw_> eph3meral: [disclaimer] I'm not a mongo specialist, far from it, but I do have some experience. From my experience, no, there's nothing like "views" in regular SQL.
[03:30:54] <eph3meral> ok, that's what I thought, so far in my googling
[03:31:17] <cesarkaw_> eph3meral: You can do some complex computations in mongo (like mapreduce or aggregation), but you'll query the db every time
[03:31:27] <eph3meral> cesarkaw_, what about something similar to "CREATE TABLE featured_employees AS SELECT blah FROM employees WHERE blah"
[03:31:28] <joannac> afaik, nothing like a view in mongodb
[03:31:51] <cesarkaw_> eph3meral: you could do that with a mapreduce query...
[03:32:26] <joannac> you could do it with a find.forEach()
[03:33:21] <eph3meral> k, that query would "run every time" though, right? is there any semblance of "query caching" in mongo aside from if you have enough RAM it'll use RAM when it can
[03:33:36] <cesarkaw_> eph3meral: no.
[03:33:43] <eph3meral> k
[03:34:43] <cesarkaw_> eph3meral: On the other hand, (according to the docs) mongodb stores data in a way that's closer to the way it talks to the client, so caching (for simple queries like key/value ones) is usually not needed
[03:35:45] <cesarkaw_> eph3meral: the view thing sounds more like couchdb
[05:12:34] <ashr_raiteri> Has anyone used underscore.js in the MongoShell? I can get it working, but it fais when I use underscore in a mongo map reduce function, because it doesn't resolve the _ object from underscore
[05:15:20] <cesarkaw_> ashr_raiteri: I think you'll have to recompile mongo if you want to inject a new function into its core, but I might be wrong.
[05:18:21] <ashr_raiteri> ugh
[05:19:17] <ashr_raiteri> There's a great blog post about using underscore in the mongo shell: http://gregorowicz.blogspot.com/2010/12/using-underscorejs-with-mongodb.html
[05:19:29] <ashr_raiteri> But he uses a ruby driver and then does an eval. I'm working directly in mongoshell.
[05:20:05] <ashr_raiteri> THis simple gist shows how to load the library in the mongoshell. And it works for regular operations. https://gist.github.com/vidoss/2178987
[05:20:52] <ashr_raiteri> But it doesn't work in the map reduce context, defining a reduce function that uses any functions from underscore will result in an Unknown Reference related to "_" the underscore obect.
[05:21:08] <cesarkaw_> ashr_raiteri: loading a library into the shell should work for code that runs in the shell. Mapreduce functions are run in the server.
[05:21:18] <ashr_raiteri> AH!
[05:21:27] <ashr_raiteri> Ok, now I get what's going wrong.
[05:22:02] <ashr_raiteri> If I figure out how to save the library into the Server using the save js capabilities…then I could possibly use them in mapreduce
[05:23:28] <cesarkaw_> ashr_raiteri: apparently, you can add functions to the server context via loadServerScripts
[05:23:38] <cesarkaw_> ashr_raiteri: but I don't know about injecting variables.
[05:24:18] <ashr_raiteri> Yeah, that's what I was thinking of doing.
[05:25:10] <ashr_raiteri> Maybe I should rethink my approach. What I really want is access to a good sortBy in the mapReduce finalize function!
[05:25:20] <ashr_raiteri> is there a better way of doing that?
[05:26:09] <cesarkaw_> Uh... Copy the code from the underscore library?
[05:29:56] <ashr_raiteri> Hah!
[05:30:17] <ashr_raiteri> The sortBy function references the pluck function which references the map function.
[05:30:36] <ashr_raiteri> so, I was going to store each of those separately…I'll give it a shot
[05:52:43] <ashr_raiteri> https://gist.github.com/ashrocket/7065471 This worked ! So, now I have a subset of _ available in my map reduce functions..
[08:22:03] <ashr_raiteri> Does the output of a reduce function have to be in the same doc structure as the input? Is this to handle the indeterminateness of how many times reduce will be called?
[08:42:40] <sontek> How does the document store when updating data? If I have something like {'id': 1, {'questions': [ ... ] } if I need to update 1 question in the array, is that updating the whole document?
[08:42:52] <sontek> I'm wondering when I have 2-3 users all working on the same thing
[08:45:42] <Derick> sontek: yes
[08:46:16] <Derick> it's an atomic operation though, as long as you use proper operators and don't read+write in your application
[12:44:56] <jdo_dk> Is it possible to get "info" about how many documents deleted/removed by: db.collection.remove({'domain':'domain.tld'}) ?
[13:01:50] <Scorchin> Are there any issues with running Mongo inside of an LXC container?
[13:45:11] <randomlurker> Do the update modifiers have some sort of execution order? If yes, could you link me to the document where it's explained. (I'm referring to the $inc, $set, $setOnInsert..)
[14:12:54] <randomlurker> !help
[14:12:54] <pmxbot> !8ball (8) !acronym (ac) !anchorman !annoy (a, bother) !bender (bend) !bitchingisuseless (qbiu) !blame !bless !boo !bottom10 (bottom) !calc !chain !cheer (c) !c
[14:12:54] <pmxbot> ompliment (surreal) !config !ctlaltdel (controlaltdelete, controlaltdelete, cad, restart, quit) !curse !dance (d) !deal !define (def) !demotivate (dm) !disembow
[14:12:55] <pmxbot> el (dis, eviscerate) !duck (ducky) !embowel (reembowel) !emergencycompliment (ec, emercomp) !excuse (e) !featurecreep (fc) !fight !flip !fml !gettowork (gtw) !g
[14:12:55] <pmxbot> olfclap (clap) !google (g) !googlecalc (gc) !grail !haiku !hal (2001) !hangover !help (h) !hire !imotivate (im, ironicmotivate) !insult !job (card) !karma (k) !
[14:12:55] <pmxbot> keelhaul (kh) !klingon (klingonism) !log !logo !logs !lunch (lunchpick, lunchpicker) !meaculpa (apology, apologize) !motivate (m, appreciate, thanks, thank) !mu
[14:12:55] <pmxbot> rphy (law) !nailedit (nail, n) !nastygram (nerf, passive, bcc) !norris () !notify !oregontrail (otrail) !panic (pc) !password (pw, passwd) !paste !pick (p, p:,
[14:12:56] <pmxbot> pick:) !progress !quote (q) !r (r) !resolv !roll !rubberstamp (approve) !saysomething !simpsons (simp) !stab (shank, shiv) !storytime (story) !strategy !strike
[14:12:56] <pmxbot> !tgif !therethere (poor, comfort) !ticker (t) !time !tinytear (tt, tear, cry) !top10 (top) !troutslap (slap, ts) !urbandict (urb, ud, urbandictionary, urbandefi
[14:12:56] <pmxbot> ne, urbandef, urbdef) !version (v, e, r) !weather (w) !where (last, seen, lastseen) !wolframalpha (wa) !zinger (zing) !zoidberg (zoid)
[15:55:59] <mongodb446> My collection looks like this users = {"profile": {"email": "a@b.com"}}, how can I do .find_one by email?
[15:56:37] <mongodb446> db.collection.find_one({"profile": {}})
[15:56:50] <mongodb446> db.collection.find_one({"profile": {"email": email}}) isn't owrking
[16:01:44] <mongodb446> nvm
[17:47:09] <digitalknight> hi all
[17:47:19] <digitalknight> i am a database developer
[17:47:28] <digitalknight> with experince in database internals
[17:48:03] <digitalknight> i would like to contribute to mongodb,preferably in query planning or performance parts
[17:48:21] <digitalknight> please guide me in this
[17:53:42] <meadhikari> hello all, when i try DOM Nodelist as a value i always get "Segmentation Fault", please help what to do