PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Saturday the 19th of October, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[02:37:43] <snkcld> how do i push to an array, but only if the element isnt already in the array?
[02:41:04] <cheeser> http://docs.mongodb.org/manual/reference/operator/update/addToSet/
[05:08:20] <snkcld> cheeser, thanks. thats perfect. is there a convenient function which removes it if its in the set, and adds it if not?
[05:42:35] <BlakeRG> how do i query against a collection name with a space in the name?
[08:53:51] <snkcld> how do i find all where a field has an array that contains, for example, an element with value "1"
[08:56:31] <snkcld> it looks like $all should do it, but it doesnt seem to work
[08:58:25] <snkcld> for example,check this out http://i.imgur.com/wIql2WN.png
[08:59:11] <snkcld> also the same is happening whether or not their are quotes
[09:12:17] <joannac> you don't need the $all
[09:12:59] <joannac> find({"favourite_artists": 8092})
[09:15:12] <snkcld> ahh, i also just noticed its because i needed to add .fetch()
[09:15:17] <snkcld> but thanks for that, too joannac
[09:15:46] <snkcld> oh,it looks like it is necessary actually
[09:16:34] <joannac> Maybe I misunderstood what you're looking for.
[09:16:35] <snkcld> nvm, yea, you were right
[09:16:38] <snkcld> thanks
[09:16:48] <joannac> np
[09:45:48] <svm_invictvs> if I am using the Java drivers, how do I shutdown a server?
[09:46:04] <svm_invictvs> db.command ("{shutdown : 1 }");
[09:52:08] <joannac> It takes a DbObject
[09:52:51] <joannac> So
[09:52:54] <joannac> db.command( new BasicDBObject( "shutdown", 1 ) );
[09:52:56] <joannac> ?
[09:54:26] <svm_invictvs> It throws EOFException allt he time
[09:56:54] <joannac> Um... once you shut down the server the socket is dead... so isn't that what you expect?
[10:12:26] <Psi|4ward> got a E11000 duplicate key error index: ersatz.fs.chunks.$_id_ dup key
[10:12:38] <Psi|4ward> any hints? Bug in GridFS?
[14:21:50] <miau> could sb explain how can i query/output the content of a file saved in fs.files in mongodb... its a bit strange imho
[20:01:46] <abonilla> Hi - does anyone know what is the equivalent of --rest for mongod parameter but for the config file?
[20:35:20] <fedorovmatt> wondering if someone could help me out. im having trouble with mongodb multiparallelism inserting and selecting. i keep getting 503 server unavailable errors
[20:35:43] <fedorovmatt> not all the time, just randomly throughout the process
[20:37:00] <neeky> anyone use mongoose driver? I've having a bitch of a time with the almost undocumented Query object
[21:12:59] <tpayne> db.favorites.aggregate({"$match":{"eid":"1427"}, {"$group":{"_id":"$gid","count":{"$sum":1}}}}) does anyone know what's syntactically wrong with this?
[21:20:23] <cheeser> just getting no results back?
[21:23:19] <dllama> hi guys, quick question. can someone please tell me how to do a full db backup? i have a 14gb db, and when using mongodump, the dump folder was 3gb, is that normal?
[21:23:30] <dllama> so i'm not 100% sure if i should be using mongodump or mongoexport
[21:23:51] <dllama> and if going the mongoexport route, whats the syntax for exporting the entire db and all of its collections?
[21:23:55] <dllama> thank you very much in advance
[21:26:10] <cheeser> what does "db.stats()" say in the shell for that db?
[21:27:19] <dllama> hi cheeser
[21:27:21] <dllama> for which field?
[21:27:26] <dllama> it gave me a bunch of data
[21:27:36] <cheeser> right. there's a datasize property.
[21:27:43] <dllama> 5678690036
[21:27:45] <cheeser> is that roughly the size of the dump?
[21:27:50] <dllama> no, dump is about half of taht
[21:27:56] <dllama> full dump is 3.3gb
[21:28:53] <dllama> during the dump, when it says "collection file writing" , what is the % next to it? is that the compression rate?
[21:29:04] <cheeser> what does filesize say?
[21:29:13] <cheeser> % done maybe?
[21:29:32] <dllama> https://gist.github.com/mvoloz/0bb5194ba0ccf7f25a3d
[21:29:38] <dllama> thats the verbose output
[21:29:50] <dllama> oh i see what you mean
[21:29:56] <cheeser> yeah. % done.
[21:30:10] <dllama> i hadn't noticed that it was the same file, rather odd that it would just keep displaying that line by line
[21:30:16] <dllama> fileSize" : 12812550144
[21:30:26] <cheeser> hrm.
[21:30:50] <dllama> 1 sec, i'm going ot add the stats to the gist
[21:31:11] <cheeser> here's what those stats mean: http://docs.mongodb.org/manual/reference/command/dbStats/
[21:31:13] <dllama> https://gist.github.com/mvoloz/0bb5194ba0ccf7f25a3d
[21:32:30] <cheeser> my *guess* is that the difference is likely the padding factor.
[21:32:43] <dllama> hmm alright
[21:32:52] <cheeser> you might try reimporting that dump into another db and comparing the stats once indexes are factored in, etc. etc.
[21:33:16] <dllama> i dont know if i have enough storage space available to reimport lol
[21:33:34] <dllama> didn't expect it to be this big initially
[21:34:27] <cheeser> :)
[21:34:51] <cheeser> you can also try "wc -l <dump file>" and see if the lines match the record count.
[21:34:59] <cheeser> (grasping at straws here :) )
[21:37:34] <dllama> this is way above my head lol
[21:37:51] <dllama> i have no idea, just going to take a leap of faith and hope that the db exported correctly :)
[21:37:57] <dllama> i ran it 3 times and each time was exaclty the same size
[21:38:44] <cheeser> i think you're fine, personally, though I understand your wariness around the differing numbers.
[21:39:32] <dllama> alright lol
[21:56:42] <joannac> Did you sum all the dumped objects, and compare to the numObjects in db.stats() ?
[21:56:54] <joannac> you'll bemissing a couple of _id indexes, but that should be it
[21:58:05] <dllama> oh boy, running a de-duping 44k objects (all of which are processed pdf files)… a little nervous to say the least :)
[21:58:42] <dllama> also hoping that once i'm done with this and i can remove the html version of the pdf from teh db it self, it'll be back to running nice an dfast
[21:59:09] <dllama> if this goes wrong, i have the export, if that fails, looksl ike its going to be another 4-5 days of processing pdfs lol
[22:06:12] <tpayne> this channel is dead as fried chicken
[22:07:39] <partycoder> it was active a while ago
[22:08:00] <cheeser> you've been here 3 minutes...
[22:08:49] <tpayne> i asked this relatively simple question but it was dead before
[22:08:55] <tpayne> glad someone responded !:)
[22:08:57] <tpayne> db.favorites.aggregate({"$match":{"eid":"1427"}, {"$group":{"_id":"$gid","count":{"$sum":1}}}}) does anyone know what's syntactically wrong with this?
[22:09:07] <cheeser> i actually responded.
[22:09:52] <tpayne> cheeser: oh sorry bud
[22:09:59] <tpayne> i thought it was dead
[22:10:39] <tpayne> closed my laptop
[22:10:49] <tpayne> if you could repeat what you said, i'd be greatly appreciative
[22:11:05] <cheeser> 17:19 < cheeser> just getting no results back?
[22:11:14] <tpayne> cheeser: i get results back
[22:11:21] <tpayne> i get a gid, and a count
[22:11:30] <tpayne> oh sorry
[22:11:41] <tpayne> i'm mixing two different questions
[22:12:08] <tpayne> i get this: JavaScript execution failed: SyntaxError: Unexpected token {
[22:12:34] <cheeser> well, aggregate takes an array of documents...
[22:13:05] <cheeser> you're missing a } before that first ,
[22:13:39] <tpayne> ahh thanks!
[22:13:59] <tpayne> ok and the follow up question is, _id is returning me gid, but i'd like to return something else as well, a key called name, how can i alter it to do that?
[22:14:12] <cheeser> $project
[22:15:16] <tpayne> that would be another document in the aggregate function?
[22:15:27] <cheeser> yeah http://docs.mongodb.org/manual/core/aggregation-introduction/
[22:23:29] <tpayne> cheeser: so i tried this: db.favorites.aggregate({"$match":{"eid":"1427"}}, {"$group":{"_id":"$gid","count":{"$sum":1}}}, {"name":1})
[22:23:40] <tpayne> and it's saying "exception: Unrecognized pipeline stage name: 'name'",
[22:23:58] <tpayne> from my understanding, that is a projection, and i'm adding it to the list of documents
[22:24:02] <tpayne> unless the position is wrong
[22:24:06] <cheeser> no, that's not a project.
[22:24:09] <cheeser> projection
[22:24:15] <cheeser> you need a $project
[22:25:49] <tpayne> db.favorites.aggregate({"$match":{"eid":"1427"}}, {"$group":{"_id":"$gid","count":{"$sum":1}}}, {"$project":{"name":1}})
[22:26:11] <tpayne> this runs, but it gives me back only an array of objects that contain the _id, strange
[22:29:54] <tpayne> cheeser: ^
[22:43:25] <tpayne> cheeser: you still there buddy?
[22:51:22] <samholmes> Is it better to install mongodb using brew or the OS X installer on OS X?
[22:52:02] <cheeser> tpayne: $project needs a field returned by earlier stages in the pipeline
[22:52:24] <tpayne> cheeser: how would that look
[22:52:54] <cheeser> { $project : { "$_id" : 1 }}
[22:53:08] <cheeser> you only have that one field from your group
[22:53:24] <cheeser> samholmes: homebrew is fine
[22:53:27] <samholmes> k
[22:55:30] <tpayne> i see, so that's why it's returning only _id
[22:55:36] <tpayne> but how do i add more groups
[22:55:43] <tpayne> i mean more fields
[22:56:24] <cheeser> $project earlier in the pipeline
[22:56:30] <cheeser> iirc
[22:59:25] <tpayne> oh i see
[22:59:33] <tpayne> ok let me try that
[23:00:50] <tpayne> hmm still giving weird results
[23:00:55] <tpayne> i'm just going to try another approach
[23:00:56] <tpayne> thanks
[23:01:47] <samholmes> How do I make mongod run?
[23:02:12] <cheeser> just run it?
[23:02:30] <tpayne> samholmes: ./mongod
[23:02:35] <tpayne> or ./mongod --auth
[23:04:01] <samholmes> what about launchctl?
[23:04:56] <cheeser> there's a plist file. just pass that to launchctl
[23:05:42] <samholmes> cheeser: I followed the instructions after installing it, but the client still can't connect
[23:06:28] <cheeser> did you load the plist or start mongod manually?
[23:07:29] <samholmes> Is mongo really light weight like redis?
[23:07:46] <cheeser> yeah
[23:08:15] <samholmes> So it's just a single binary that I can run and have multiple mongod's on my hard disk?
[23:09:40] <cheeser> sure. you can run an entire sharded cluster on your machine for dev work.
[23:11:23] <samholmes> Eh, I have no idea about launchd to be honest. I'm just following commands blindly..
[23:11:40] <samholmes> How can I tell if mongod is running?
[23:11:56] <cheeser> by connecting to it. :D
[23:12:03] <cheeser> or: ps axuw | grep mongod
[23:14:33] <samholmes> looks like it's not running
[23:15:29] <cheeser> launchctl load <path to plist>
[23:43:39] <eph3meral> so, I recently had a friend recommend mongo db because "One big thing is intellegent caching where you want to run through a stored object for addition querying "
[23:43:53] <eph3meral> does anyone know which feature and or part of the docs I can read to understand what he's referring to?
[23:44:04] <eph3meral> I think he may have meant additional* querying