PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Tuesday the 11th of March, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:25:49] <joannac> brucelee: http://docs.mongodb.org/manual/faq/diagnostics/#does-tcp-keepalive-time-affect-sharded-clusters-and-replica-sets
[00:48:22] <joshua> Can anyone tell me, when you set up a unique index and tell mongodb to dropdups, how does it decide which ones to keep?
[00:48:41] <joshua> Or if I am asking maybe I shouldnt be using it as a quick way to remove duplicates :)
[00:51:42] <joannac> it keeps the first one it sees, and drops the rest
[00:53:00] <joannac> if you have questions about "how do i tell which is the first one it sees" you should probably do the dropping yourself
[00:57:01] <joshua> Someone restarted a group of app servers and started mongod instead of mongos. What a mess.
[01:00:06] <joshua> The dupes are based off a compound of two fields, I can get those out of aggregation framework at least. Not a huge amount so probably doesn't matter. Client will re-create the data anyway if its missing.
[01:00:40] <quantalrabbit> trying to install mongodb on ubuntu 12.04 with these instructions and it fails with "W: Failed to fetch http://downloads-distro.mongodb.org/repo/ubuntu-upstart/dists/precise/10gen/binary-amd64/Packages 404 Not Found" Any help greatly appreciated!
[01:01:50] <joannac> with which instructions, quantalrabbit ?
[01:02:17] <quantalrabbit> oops... with these: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
[01:02:23] <joannac> cheers
[01:03:19] <joannac> this is the correct URL
[01:03:20] <joannac> http://downloads-distro.mongodb.org/repo/ubuntu-upstart/dists/dist/10gen/binary-amd64/
[01:03:24] <joannac> trying to repro now
[01:05:20] <quantalrabbit> joannac: thanks! i think i made a silly error.
[01:06:04] <joannac> oh... so I shouldn't bother trying to reproduce?
[01:06:48] <quantalrabbit> no.. don't try. i did not follow the instructions to the tee (literally).
[01:07:16] <joannac> ah. hehe
[01:08:40] <quantalrabbit> used salt (saltstack) to install place the specify the add the repo in a the file /etc/apt/sources.list.d/mongodb.list but specified "dist: precise" . "dist: dist" works.
[02:38:26] <whatadewitt> hello, is it possible for me to update all records mongo database using mongoose to "multiply" a value in my database?
[02:38:55] <whatadewitt> i basically have a constant that i want to multiply all my values with in a single "update" using mongoose
[02:39:08] <whatadewitt> and apparently i need someone to teach me how to explain these things :D
[03:20:24] <jfisk1987> hey guys
[03:28:16] <has09> hey guys, I installed mongodb last week on my macbook, and now i try to start it and i get this error:
[03:28:17] <has09> Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145
[03:28:17] <has09> exception: connect failed
[03:30:07] <has09> ok, just solved my own issue. i hadn't start the service yet..
[03:30:11] <cheeser> :)
[04:16:42] <teechap> hey everyone, i'm having some trouble running mongodb on ubuntu 12.04 on a VPS
[04:16:52] <teechap> i followed the instructions here http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
[04:19:19] <teechap> but when i issue the command "sudo service mongod start" it says it's an unknown service
[04:19:45] <teechap> and trying "mongod" doesnt work because "/data/db" doesnt exist
[04:31:56] <pierre1_> Hi. I need to create an activity schema in mongoose, that has a field 'object' which can be a User, a Post, a Group etc
[04:32:39] <pierre1_> And I need to be able to populate them later...
[04:32:52] <pierre1_> Does anybody have an idea of how to program that?
[04:34:12] <pierre1_> I've tried using Model.discriminator, but I don't think it supports .populate through parent schemas
[04:48:39] <joannac> teechap: sudo service mongodb start
[04:48:43] <joannac> you're missing the 'b'
[04:58:31] <Eckardt> hi, how do you access an index (the actual index itself)?
[05:11:08] <joannac> for what purpose, Eckardt?
[05:15:34] <pasichnyk> i'm tring to write some schema migration scripts in the mongodb shell. If i have a document with a list of properties that are country codes (e.g., { _id: "somedoc", cc: { "us": {}, "cn": {} } } ) how can i enumerate the country codes properties?
[05:15:55] <Eckardt> joannac: just wondering if mongo has an api for it, because zorba's (xquery) mongodb interface supposedly maps xquery indexes to mongo's
[05:19:27] <pasichnyk> basically, looking for the equivalent of foreach(doc.cc) { //do something with each country }
[05:22:18] <Eckardt> pasichnyk: for (var attr in doc.cc) { var c = doc.cc[attr]; /* do something */ }
[05:27:53] <pasichnyk> ok, i was making it too hard. Thanks! And in that case attr is just the name of the property, not the acutal property right?
[05:30:27] <Eckardt> yup, ecmascript 6 (mongodb uses ecmascript 5), has for (... of ...) to iterate over values, which is nicer
[05:34:01] <pasichnyk> ok, one last question then i need to take off for the night. If i'm enumerating over these fields, and i want to wipe the contents of a child property (e.g. cc.us.sales). Whats the best way to do this? I was trying to use $concat to build the field name and then doing a seperate update query back to the collection based on the _id, but i'd have to do several of those per document, and i
[05:34:01] <pasichnyk> didn't get $concat working for this. If i go though and modify the document in memory, then call db.collection.save(mydoc), seems like it could have issues with wiping out other changes that are happening (or does it only update the changed fields when you call save)?
[05:36:23] <Eckardt> mutate in memory using the delete operator (ex delete cc.us.sales), then persist the changes by updating as you normally would with mongo
[05:37:25] <pasichnyk> hrm, i just skimmed through http://docs.mongodb.org/manual/reference/method/db.collection.save/, and it looks like the save method could cause issues with overwriting other changes that are happening (these documents get frequent $inc operations on them).
[05:39:26] <Eckardt> would probably be an issue then, rather than having all of this in a single doc, it might be better to be more relational about it?
[05:41:58] <pasichnyk> ah, we're past that at this point. These are reporting summaries that can be pulled and bound to our javascript viewmodels, just accidently some extra properties under each country that i need to clean up. Plus its good to get this schema migration stuff figured out before i actually NEED it. :)
[05:42:35] <Eckardt> ok. if you look at http://docs.mongodb.org/manual/faq/concurrency/, it seems that evaluating (db.eval()) locks
[05:44:50] <pasichnyk> ok, well i can build a list of fields that need to be $unset, then build one db.collection.update() call to do them all at once for the given document. In that case though, i just need to be able to dynamically build/get each field name to add to the list. I was tryign to do this with concat (e.g., $concat: ["cc.", "$country", ".sales"]). is this a good way to go about that, or is there
[05:44:50] <pasichnyk> something easier/better? I dind't get it working, but seems like it should work and was just some syntax issue..
[05:44:58] <Eckardt> so I would believe that your mongo shell script locks mongo?
[05:46:38] <Eckardt> what was the issue with it? why didn't it work?
[05:47:48] <pasichnyk> hrm, yeah maybe. I'm just executing it through robomongo right now, but i didn't check if other things were blocked on the master. reporting site still worked fine, but it prefers secondary reads. If the db.eval() is blocking, i can just do this in chunks (as to not lock everything up for too long) with the delete method.
[05:48:51] <pasichnyk> oh, i was just trying to do this, but it was giving me sytax errors. Didn't work at it enough to get it figured out: {$unset: { {$concat: ["cc.", "$country", ".sales"]}: ""}}
[05:50:24] <Eckardt> yes, because the {$concat...} is supposed to be an attribute name
[05:50:50] <Eckardt> {{...}: ''} is invalid
[05:51:08] <pasichnyk> yeah, tahts the thing. I was trying to build that full attribute name dynamically. Is there a way i can extract it out of the 'country' variable or something?
[05:53:13] <Eckardt> it seems, as far as the the doc page for $unset goes, that it only accepts a static object
[05:53:57] <pasichnyk> hrm, so the delete method is probably the best then...
[05:55:22] <Eckardt> mongodb doesn't support subqueries, but you could have two queries, one for getting the attribute names, then building the update
[05:59:25] <pasichnyk> yeah, or maybe its easier to just do this in some other language, where i can more easily build the list of updates that need to happen for the given document, then apply them all at once and move onto the next. I'm just finding that doing it in javascript in the shell is a pain...
[06:00:12] <pasichnyk> probaly because i just don't have experience with javascript in the mongo shell, but oh well... :P
[06:02:33] <Eckardt> is this something that you will keep doing often? if it is just for now, using delete would be easy to get going.
[06:03:33] <Eckardt> or just use a mongo driver for your favorite lang (unless it is awk or something), if it would be easier for you
[06:05:31] <pasichnyk> um, i imagine we'll need to do similar stuff on one off and/or at/after deployment time (for some schema migrations, etc) now and then. If there was a nice clean way to do this in javascript that didn't make my head spin I figured that was less moving peices, and easier to build new scripts. But i'm already at that point so maybe doing this in another language with the mongo driver would be
[06:05:31] <pasichnyk> best.
[06:07:59] <Eckardt> should probably do that anyway then
[06:10:09] <pasichnyk> i just tested out the delete method, on a sample doc, and it worked well... but likely has the chance of losing other updates. So yeah... I'll look into options for providing some locking around that operation (maybe running everything in a db.eval(), but just very limitted document scope per run, or something), and look at ways to do it in another language that will still give me ease of
[06:10:09] <pasichnyk> quickily building/running new update "scripts".
[06:10:12] <pasichnyk> thanks for your help
[06:11:13] <Eckardt> I don't think you would lose other updates, I believe the concurrency doc says javascript blocks, so the other updates will just occur after.
[06:12:40] <pasichnyk> Oh, i guess i'm not (currentlY) running this from javascript directly with db.eval, i'm running it in a cursor.forEach(). That won't block will it?
[06:12:54] <Eckardt> user on stackoverflow says "As a side note, MongoDB actually has more locks than this, it also has a JavaScript lock which is global and blocking, it does not have the normal concurrency features of regular locks."
[06:14:05] <Eckardt> getting more data from a cursor has a read lock
[06:14:12] <pasichnyk> http://docs.mongodb.org/manual/faq/concurrency/#what-kind-of-concurrency-does-mongodb-provide-for-javascript-operations says taht in 2.4 there can be multiple javascript operations
[06:15:26] <pasichnyk> Ok, i'll read up more on locking in mongodb, to get a better idea of how this should all behave
[06:16:03] <Eckardt> ah, I see, in that case I would use $unset instead of delete to not lose the updates
[06:17:19] <pasichnyk> which is what i was trying originally, but back to the problem of not being able to define the field name dynamically. (there are way too many of them potentially, and some are truly dynamic so i can't hardcode a list)
[06:18:11] <Eckardt> break it up into seperate tasks, rather than in a single query.
[06:20:09] <Eckardt> a mongodb aggregate query (that uses $concat) to build the attribute names, then in javascript build a query document for the update, adding the fields to $unset (ex query.$unset['foo'] = ''), and run it.
[06:21:44] <pasichnyk> so just build it all as a string and then run with db.eval, to get around the inability to do dynamic fieldnames?
[06:25:09] <pasichnyk> you konw, i'm goign to want to do automatic schema upgrades on the fly on documents at some point (at access time) so i'll need to do this in another language anyway. I'll bite the bullet and dive in using hte mongo driver, with a language i'm more comfortable with.
[06:25:28] <Eckardt> however way you want to evaluate it, in shell, etc. so, store the result of db.foo.aggregate({$project: {attr: {$concat: ["cc.", "$country", ".sales"]}}}, iterate over each of the results, building an update object (ex var unset = {}; ... unset['cc.us.sales] = '';) then db.foo.update(..., {$unset: unset})
[06:26:19] <pasichnyk> its way past my bedtime, so i'm going to split. Thanks again for your help, and have a great night. I'll try out that example method in the AM. :)
[06:26:56] <Eckardt> no problem, you too. hope it works, or just use something you are more comfortable with. :)
[06:27:13] <pasichnyk> yeah either way, i'll give in tomororw. Cheers.
[08:38:26] <laprice> Which npm module is the best for talking to mongodb?
[08:39:34] <ron> "best"
[08:39:48] <laprice> nopm search mongodb returns 780 results
[08:40:36] <laprice> is there one that is known to be stable up to date and straightforward?
[08:40:53] <laprice> i.e. recommended.
[08:41:49] <kali> laprice: http://docs.mongodb.org/ecosystem/drivers/node-js/#node-js-language-center
[08:42:41] <laprice> kali, thanks.
[08:55:50] <scottyob> Howdy all. Is it possible to aggregate on my "community" fields in this kind of dataset? { "_id" : ObjectId("531ea4acf4250d104e713dfc"), "communities" : { "58698:100" : 69, "58698:101" : 10, "58698:102" : 40 }, "date" : "2014-03-11", "username" : "scotto" }
[09:46:22] <Diplomat> Guys, is there some kind of web GUI for mongodb ?
[09:55:50] <Diplomat> guys it's so easy :|
[09:55:54] <Diplomat> incredible
[09:58:14] <Diplomat> that's what i was doing :P
[09:58:35] <Diplomat> but i just realized how easy is to use mongodb
[09:58:38] <Diplomat> that's crazy
[10:00:39] <Diplomat> wait wtf
[10:00:47] <Diplomat> you dont create databases and tables ?
[10:00:53] <Derick> you don't have to
[10:00:53] <Diplomat> you just insert data and read that data?
[10:01:05] <intrepid-> You don't create in advance.
[10:01:06] <Derick> you can create collections (not tables) if you need special options
[10:01:21] <Diplomat> huehueh hey mate
[10:01:21] <intrepid-> data insert and structure definition happen at the same time.
[10:01:32] <Nodex> as if by magic
[10:01:35] <intrepid-> indeed
[10:01:36] <Diplomat> Zelest I'm having my mind blown here
[10:01:37] <Zelest> black magic!
[10:01:43] <Diplomat> i know, crazy
[10:01:47] <Zelest> Diplomat, I can see that.. planning on running this on DO?
[10:01:47] <intrepid-> welcome to MongoDB
[10:01:53] <Diplomat> yes sir
[10:01:58] <Zelest> Diplomat, if so, keep memory in mind..
[10:02:07] <Zelest> mongodb is a cute little memoryeating monster :D
[10:02:12] <Zelest> (but it take good use of it!)
[10:02:12] <Diplomat> lol
[10:02:13] <Derick> om nom nom
[10:02:20] <Diplomat> i guess it's not worse than mysql
[10:02:24] <Diplomat> mysql is the devil
[10:02:30] <Zelest> also, it has webscale!
[10:02:32] <Zelest> too soon? :o
[10:02:34] <Nodex> different tools
[10:02:36] <intrepid-> it's different
[10:02:37] <Diplomat> :O
[10:02:55] <Zelest> only thing I lack in mongodb is FTS :(
[10:02:58] <Zelest> and yes, it's there
[10:03:01] <Zelest> and yes, it's HUGE
[10:03:03] <Zelest> :(
[10:03:07] <Diplomat> lulz :D
[10:03:07] <Derick> huh?
[10:03:19] <Diplomat> this is so awesome, im having "awesome" overload
[10:03:36] <Zelest> Derick, I find the FTS a bit too big/bulky :/
[10:03:47] <Diplomat> when i studied Cassandra .. then it blew my mind because it was so weird
[10:03:53] <Zelest> Diplomat, let me top that with some eargasm: https://soundcloud.com/mitis/mitis-endeavors-free-download
[10:03:58] <Diplomat> and now mongo festival is even more weird
[10:04:08] <Diplomat> and yet so awesome lol
[10:04:27] <Zelest> Diplomat, wait till you discover the auto-failover built in with the drivers and the replica system :D
[10:04:39] <Diplomat> i need some fresh air
[10:05:30] <Diplomat> ok so.. um
[10:05:45] <Diplomat> i just insert stuff..
[10:05:51] <Nodex> yup
[10:06:14] <Zelest> Nodex, I consider giving my crawler another go
[10:06:20] <intrepid-> Zelest: I normally here of people slotting sold or elastic search next to MongoDB to get better FTS
[10:06:22] <Nodex> nice
[10:06:33] <Nodex> slor ftw
[10:06:35] <Nodex> solr*
[10:06:41] <Zelest> intrepid-, personally I'm in love with PostgreSQL's tsearch2
[10:06:59] <Zelest> sadly, for best performance, it suggest/"requires" that you know what language it is
[10:07:21] <Zelest> might be able to do something similar with mongo alone though
[10:07:39] <Diplomat> wait, but how do i make indexes n stuff.. do they even exist ?'
[10:07:41] <Zelest> stemming/synonyms -> array
[10:07:47] <Zelest> Diplomat, yep
[10:07:53] <Nodex> ensureIndex
[10:08:07] <Diplomat> ok. .something that makes sense
[10:08:13] <Zelest> omg!
[10:08:17] <Zelest> i just had the most amazing ide
[10:08:18] <Zelest> idea
[10:08:19] <Zelest> brb
[10:08:22] <Diplomat> lol
[10:09:15] <intrepid-> Diplomat: the online MongoDB training is EXCELLENT!
[10:09:18] <intrepid-> (and free)
[10:09:35] <intrepid-> I went through some of it early last year
[10:10:57] <Nodex> easier to learn from Google imo
[10:11:43] <intrepid-> Depends how fast you need to dive in. Was good in my case since I had no immediate requirement. Just wanted to learn a little at a time.
[10:13:21] <Diplomat> the thing is.. I'm not used with so simple things
[10:13:28] <Diplomat> that's why it blows my mind
[10:14:20] <Diplomat> anyway, im having around 100-600 inserts a second
[10:14:28] <Zelest> back
[10:14:30] <Diplomat> can mongo festival manage that kind of thing ?
[10:14:54] <Nodex> what is mongo festival?
[10:14:58] <Diplomat> sometimes it goes up to 1000 inserts a second
[10:15:09] <Diplomat> mongo festival = mongodb
[10:15:38] <Nodex> it can handle it - if your hardware can handle it
[10:15:42] <intrepid-> you've lost us with the "festival"
[10:16:10] <Diplomat> i know one guy who gets high and then he just sits quietly and just laughs.. and his eyes are sraight lines.. so we call him mongo festival and somehow everytime when i hear this name "mongodb" i think about this guy
[10:22:28] <Diplomat> this is insane
[10:22:29] <Diplomat> it works
[10:22:30] <Diplomat> lol
[10:23:12] <Diplomat> http://screencast.com/t/u8kGSC0SnbjA i just tested this
[10:23:15] <Zelest> :D
[10:23:15] <Diplomat> and it's nice and fast and it worked
[10:23:21] <Diplomat> crazy
[10:24:10] <Zelest> wonder if I dare joining #mysql with that host :D
[10:24:33] <Diplomat> :O why
[10:24:35] <Nodex> you should really cast your integers
[10:24:41] <Nodex> save some space :)
[10:24:44] <Diplomat> yes of course :D
[10:24:48] <Diplomat> i was just testing :D
[10:24:57] <Nodex> plus sorting is different on strings to integers
[10:24:58] <Diplomat> im so exited that i forgot to do it :D
[10:25:10] <Zelest> Diplomat, because it's bashing mysql? :P
[10:25:27] <Diplomat> it's structure .. how it works and how i can just write things :D
[10:25:39] <Diplomat> and hopefully it's speed too
[10:26:09] <Diplomat> i have one mysql database that's around 130GB.. in a server with 2 x E5-2600 (i think) and 192GB RAM :D
[10:26:12] <Diplomat> and it's slow as hell
[10:26:27] <Gargoyle> Diplomat: It can be VERY fast, depending on what you want.
[10:26:30] <intrepid-> It's fast, but not magic once you scale. You still need to do work as you grow.
[10:27:07] <Diplomat> I want to read lots of rows fast and that's it
[10:27:35] <Diplomat> ~20-40k rows
[10:27:38] <Nodex> there is no joins in MongoDB, so if your data is heavily relational you will need to deal with that
[10:27:53] <Diplomat> yes i know, I have been using Cassandra for some time :D it has no joins as well
[10:28:37] <Nodex> that's not what I was getting at
[10:31:34] <intrepid-> Diplomat: what sort of data & structure are you working with (if I may ask)?
[10:32:32] <Diplomat> Website traffic :)
[10:32:37] <Diplomat> And deep analysis
[10:32:38] <intrepid-> logs?
[10:32:55] <Diplomat> like clicks, scrolls, mouse movement, etc
[10:33:09] <Diplomat> and then i build reports and maps using that data
[10:36:37] <Diplomat> this is brilliant, i can use objects when im inserting data :P
[11:16:31] <Froobly> hi. if i have many users that have many lists with many items, is the normal way to store the items within each list document?
[11:16:58] <Nodex> it really depends on how you intend to access the data
[11:18:19] <Froobly> Nodex, thanks, can you elaborate or point me somewhere that explains?
[11:19:19] <Nodex> it really depends on if your data is read heavy, write heavy etc
[11:19:55] <Froobly> ok so would write heavy make it better to have the items in a different collection?
[11:20:35] <Nodex> it's never better to have things in a different collection becuase it implies a join
[11:20:56] <Nodex> that being said you can minimise the impact with some tricks
[11:21:10] <Froobly> oh?
[11:21:42] <Nodex> one example might be a blog post with the last 10 comments embedded inside it, more comments are stored elsewhere
[11:21:57] <Froobly> interesting
[11:22:29] <Nodex> in the event a user wants to see more comments then the join happens but it's infrequent, you get speed and scalability for documents but you trade space and managment difficulties
[11:22:38] <Diplomat> http://puu.sh/7rfgy.png guys.. any ideas why my query doesn't return anything?
[11:23:03] <Nodex> what is $today?
[11:23:05] <Diplomat> it should return ~900 arrays
[11:23:50] <Froobly> "it really depends on how you intend to access the data" <-- so you weren't talking about joins as one of the options here Nodex?
[11:24:10] <Froobly> if not, what would i be deciding between?
[11:24:32] <Nodex> Froobly : I mean more along the lines of access patterns
[11:25:28] <Nodex> in the blog post example if the post itself inc the embedded comments were accessed more than the rest of the comments then this makes sense
[11:26:01] <Nodex> if your app finds that one more page of comments are accessed then it makes more sense to embedd more comments into the original post to save the extar uery
[11:26:04] <Nodex> query*
[11:26:16] <Froobly> right, so if all the items are almost always viewed with the lists then shove them all in the same collection
[11:27:06] <Nodex> it's really down to your app, you know it better than we do, we can't comment what might be best
[11:27:29] <Froobly> just wondering if my thinking is getting any better, trying to change my thinking from sql
[11:27:41] <Nodex> if your aim is performance then you want the path of least resistence (the path with the least number of queries)
[11:28:40] <Nodex> here is another example. I have an email alert list, a user creates a list, in relational DB's you might just store the UID and do a join, whereas I would store the UID, name, email, other info I needed to send out the alert
[11:28:44] <Nodex> + without doing the join
[11:29:24] <Nodex> that does mean that if the user changes their email that I have more collections to update but that's less frequenct than the reads needed for the alert
[11:29:41] <Froobly> gotcha
[11:30:30] <Nodex> it really does depend on your end goal. Mine is always performance, for other people they want data scale
[11:30:38] <Nodex> storage scale*
[11:31:13] <Froobly> as in they don't want to update lots of email addresses?
[11:31:51] <Nodex> they don't want lots of duplicate data because of disk cost
[11:32:07] <Nodex> and probably management nightmares
[11:32:10] <Froobly> right. thanks nodex, makes things a bit clearer :)
[11:32:24] <Nodex> just gotta work out what's best for you and write it like that
[11:39:52] <Diplomat> my find query is failing :(
[11:40:13] <Nodex> I already asked you once. What is $today?
[11:40:16] <Gargoyle> Diplomat: pastebin it
[11:40:27] <Diplomat> $today = strtotime('today'); :P
[11:40:46] <Nodex> pastebin a typical document
[11:40:51] <Diplomat> http://pastebin.com/QrUqxcY8
[11:41:06] <Nodex> db.foo.findOne();
[11:41:19] <Diplomat> I need all the rows not one
[11:41:24] <Nodex> db.visitor_click.findOne();
[11:41:34] <Nodex> please pastebin the result of that command
[11:42:26] <Diplomat> empty page :P
[11:42:37] <Nodex> select the db first
[11:42:47] <Nodex> "use tracker"
[11:43:03] <Gargoyle> Diplomat: In the mongo shell, not your php code.
[11:44:20] <Diplomat> there it works http://screencast.com/t/x29pxJOH4G
[11:44:42] <Diplomat> wtf, my project_id and site_id are string ?
[11:45:00] <Nodex> because you didn't cast them
[11:45:12] <Nodex> I did warn you about casting but you said you were testing
[11:45:29] <Diplomat> they are ints :(
[11:45:35] <Diplomat> ill add a cast then
[11:45:39] <Nodex> cast them as ints then
[11:45:48] <Nodex> and your doubles as floats
[11:46:01] <Derick> they are strings because they came in through $_GET/$_POST
[11:46:11] <Derick> all variables coming in through those are strings
[11:46:21] <Derick> Diplomat: http://derickrethans.nl/mongodb-type-juggling.html
[11:46:46] <Derick> Diplomat: i suggest you read that
[11:46:55] <Nodex> I find it easiest to cast everything, in and out
[11:47:04] <Derick> sure
[11:47:46] <Diplomat> ok now it's working fine
[11:48:03] <Gargoyle> Oooh, new PHP driver release candidate. :-) Maybe I can segfault this one :D
[11:48:08] <Nodex> I'm not sure how mongo reacts to $gt on a string
[11:48:15] <Derick> Gargoyle: please try!
[11:48:19] <Diplomat> yay works
[11:48:36] <Derick> Gargoyle: that's why we put out RCs :-)
[11:48:59] <Gargoyle> he he. Not doing any where as much as I was when I kept breaking the 1.3 one!
[11:49:14] <Gargoyle> But I have been playing with 2.6 FTS this morning.
[11:49:23] <Derick> it does help we rewrote loads of the driver
[11:51:20] <Diplomat> yay, im happy again
[11:53:01] <Diplomat> hm .. i could use it like i use Mysql
[12:02:56] <Diplomat> hmm mongo festival writes pretty fast too
[12:02:58] <Diplomat> that's really great
[12:03:02] <Diplomat> and reads pretty fast too
[12:03:25] <Derick> what is mongo festival?
[12:03:36] <Diplomat> i mean mongodb
[12:03:50] <intrepid-> yes. But keep in mind that you are not replicating yet. And once you are, you need to consider how consistent you want the writes to be
[12:04:02] <Diplomat> yup
[12:04:06] <Derick> more, how consistent you want the reads to be
[12:04:36] <Diplomat> well writes need to go through no matter what.. and i need to get ALL the data
[12:04:37] <intrepid-> that too
[12:05:04] <intrepid-> Diplomat: so you want every node in the replica set to write before the client disconnects?
[12:05:15] <intrepid-> that will slow you down
[12:05:21] <Diplomat> i really cant have that on one request i get like.. 8 results and next time 5
[12:05:28] <Derick> intrepid-: you can't really do that actually, without being things flexible
[12:05:41] <intrepid-> Derick: yeah
[12:05:45] <Derick> intrepid-: you can ensure that the majority has been written to
[12:05:57] <intrepid-> Derick: that's more so what I meant
[12:06:03] <Derick> Diplomat: which mean you can only read from the primary
[12:06:20] <Diplomat> doesnt matter as long as i get what i want
[12:06:27] <Diplomat> that's the most important part
[12:16:56] <Diplomat> nice
[12:17:03] <Diplomat> 0.001 sec
[12:17:12] <Diplomat> Mongo: 0.0012509822845459
[13:16:40] <p3rror> hello
[13:24:39] <Nodex> yawn
[14:04:11] <nicktodd> My current file has this line: -A OUTPUT -p tcp --src mms.mongodb.com -j ACCEPT
[14:04:31] <nicktodd> What is the best way to test that this is correct? Thanks.
[14:05:00] <nizze> Hello
[14:06:23] <Number6> nicktodd: doesn't --src need an IP address?
[14:07:14] <nizze> I have a really huge dataset (64million records) and I'd like to reduce it to a smaller dataset. If the dataset would be simpler I would first group by record's url and then by records's created-at, split it to 15min intervals and keep each interval's first record.
[14:07:34] <nizze> But now it seems that ordinary mongo tools do not cut it any more.
[14:07:42] <nizze> Any tips / blogposts?
[14:07:54] <nizze> Errors that I get are like: "exception: distinct too big, 16mb cap"
[14:08:12] <nizze> So basically all sorts for memory limits are being exceeded.
[14:08:28] <nicktodd> number6 I tried that (with and without src) and that didn't work either.
[14:09:10] <Nodex> nizze : have you tried aggrgation?
[14:11:51] <nizze> as in db.collections.aggregate() ?
[14:13:45] <Nodex> yup
[14:17:19] <nizze> Nodex: yes, but I hit all sorts of memory limits on that one also. I'd be happy to take a batch of 1000 * 100 records and process them.
[14:17:37] <nizze> And then move to next 1000 * 100
[14:19:26] <Nodex> you're going to have to map/reduce I think because grouping and or aggregation will hit the memory llimits
[14:19:29] <Nodex> limits*
[14:19:54] <Number6> nicktodd: mms.mongodb.com will never send you a connection request, everything is pushed out from your MMS node
[14:19:58] <Number6> On 443
[14:21:15] <nizze> Nodex: and map/reduce won't?
[14:21:34] <nizze> I'm afraid I'll hit the maximum bson doc limit even on that one.
[14:21:37] <Nodex> I don't think it has the memory limits of the other two
[14:23:35] <nizze> Nodex: okay thanks.
[14:24:11] <Nodex> in the future you may wish to pre-aggregate some of the things you need to save you running in to problems
[14:24:42] <nizze> Nodex: http://docs.mongodb.org/manual/core/map-reduce/
[14:25:00] <nizze> When returning the results of a map reduce operation inline, the result documents must be within the BSON Document Size limit, which is currently 16 megabytes.
[14:25:25] <xerxas> Hi ! I came accross this code: https://github.com/mongodb/mongo/blob/master/src/mongo/db/geo/geoquery.h#L76
[14:25:34] <xerxas> bool intersects(const S2Cell& otherPoint) const;
[14:25:44] <xerxas> Can I use s2cell to query my data ?
[14:26:04] <xerxas> couldn't find any doc on this , but I want to sort my results by s2cells
[14:26:29] <Nodex> nizze : then you will have to pipe the map/reduce back to a collection or something then. It's not something I know a great deal about
[14:26:30] <nicktodd> Number6: something like this: -A OUTPUT -p tcp -d mms.mongodb.com --dport 443 -j ACCEPT ?
[14:29:25] <nizze> Nodex: thanks for your help, I'll check the map/reduce anyways
[14:31:40] <Nodex> no probs, good luck
[14:45:49] <kAworu> Hi
[14:46:51] <bodie_> looking for a little guidance with mgo if anyone is familiar with it
[14:47:11] <bodie_> i'm trying to marshal into a struct that has a slice in it...
[14:48:04] <bodie_> basically, to get a document that has a list of strings as one of the fields... in go, which deals with these things in a slightly weird way
[14:48:34] <kAworu> I'm trying to use the $where operator in Node.js with a context but I could not find how.
[14:48:45] <kAworu> my driver is mongoskin
[14:50:16] <bodie_> ah, this seems relevant
[14:50:25] <bodie_> https://groups.google.com/forum/#!topic/mgo-users/UMvRR4jBVH0
[14:50:39] <bodie_> "JSON ignores anonymous embedded structs"
[14:51:42] <kAworu> it's like: collection.find(function () { this.confirmed + n < this.capacity })
[14:52:50] <p3rror> I can not connect to database
[14:52:57] <p3rror> I have this message
[14:52:59] <p3rror> Tue Mar 11 14:52:11.964 listDatabases failed:{ "ok" : 0, "errmsg" : "unauthorized" } at src/mongo/shell/mongo.js:46
[14:53:55] <kees_> "unauthorized" gives it away
[16:09:08] <wc-> hi all, i was wondering, is a query like {'field': {'$ne': false}} slower than {'field': true}
[16:09:20] <wc-> does that cause a table scan or bypass indexes or anything?
[16:09:24] <Derick> yes
[16:09:33] <Derick> field: true can use an indexed lookup
[16:09:40] <Derick> field: { $ne: false } can not
[16:12:28] <wc-> ok thats good to know, thank you
[16:12:47] <wc-> im refactoring some code where a guy converted all x: false to x: $ne: true
[16:12:56] <wc-> on the fly
[16:13:03] <wc-> i wanted to make sure my thoughts were correct
[16:13:43] <Nodex> null !=false and "" !=false
[16:14:36] <Nodex> (I have never tried this but).... {field : {$in [false,null,""]}} ..... might cover use cases better and I am pretty sure that $in uses an index
[16:15:08] <wc-> i mean this code is looking for exactly a boolean query like field: false or field: true
[16:15:17] <wc-> and rewriting it to field: {'$ne': opposite}
[16:15:21] <wc-> seems bad?
[16:15:25] <bodie_> can anyone explain why mgo lowercases field names of structs when inserting a new document?
[16:15:27] <wc-> why not just keep it as the boolean query
[16:15:57] <bodie_> I want my field names to match the struct exactly
[16:15:59] <Nodex> but $ne : false is looking for anything that's NOT false
[16:22:31] <kali> Nodex: you sound like a saul goodman
[16:22:42] <kali> s/ a//
[16:23:31] <wc-> Nodex: thats a good point, these fields are eihter true or false based on schema validations, if we have a null or some other value then something else has gone wrong
[16:23:53] <wc-> so if the field is strictly true or false, it seems like converting x: true to x: {'$ne': false} and missing indexes is a bad thing?
[16:26:35] <Nodex> wc- if you're certain of the values then you can do false but if you're not then might make sense to include the rest
[16:26:50] <wc-> in this specific case we are certain
[16:26:59] <Nodex> and yes, if you know the value is true or false then that conversaion is a very silly thing
[16:27:15] <wc-> and it gets included in every. single. query.
[16:27:20] <Nodex> in his defence he might not have known that it didn't use an index
[16:27:24] <wc-> he didnt
[16:27:55] <Nodex> he should be publicly ridiculed non the less !!
[16:31:43] <wc-> haha nah that wont help, i just wanted to make sure my assumptions about indexing were correct before i submitted this pull request
[17:06:04] <zumba_addict> hi folks, I have a mongodb that I built 2 years ago. I forgot how I made the structure of the table
[17:06:44] <Gargoyle> zumba_addict: You didn't.
[17:06:47] <Gargoyle> :)
[17:08:14] <Gargoyle> zumba_addict: MongoDB doesn't have a rigid schema like a relational database. You can have documents with different structures in the same collection.
[17:08:45] <gsd> can someone point to me to a resource that explains the relationship between servers and replica sets? they each have pooling and im not sure how many pools/conns get created when you have a server pool of 5 and a replSet pool of 5
[17:09:33] <gsd> if i have a 3 mongod's (1 primary, 2 secondaries) and my server conf has pool size 5 and my replSet has a pool size 5, how many pools and connections do i have
[17:33:55] <zumba_addict> sorry folks, got invited to grab some food outside. I'm back now
[17:34:18] <zumba_addict> yes Gargoyle, I meant documents
[17:38:03] <zumba_addict> looks like it recreated it on my other mongod :)
[17:38:12] <zumba_addict> all I did is insert a new data
[17:38:22] <Gargoyle> Yup.
[17:38:29] <Gargoyle> It just works.
[17:38:30] <zumba_addict> :)
[17:38:34] <zumba_addict> how do we secure it?
[17:38:42] <Gargoyle> firewall
[17:38:43] <zumba_addict> like adding username/pass auth
[17:39:10] <Gargoyle> You can get info on mongodb.org. I don't use built in authentication.
[17:39:17] <zumba_addict> k
[17:39:39] <zumba_addict> Glad I have a Robomongo client. That's where I saw my documents
[17:40:30] <Gargoyle> Oooh. Not heard of robomongo... that looks nice.
[17:40:52] <Derick> i like the name
[18:01:59] <MacWinner> when setting up mongo for the first time in an environment that you expect to grow in the medium term, should you just setup a basic replica set?
[18:02:17] <MacWinner> is that the best starting point to expand to the 11 node super HA cluster config?
[18:02:59] <MacWinner> I currently have a single mongodb node that I've been testing stuff on.. it's not high volume at all, but I want it to be as close as possible to the future state
[18:04:42] <starfly> MacWinner: your mileage will vary, the more setup done earlier, the better you'll have a feel for how the environment will play when you get to the super config, but setup is work...
[18:05:28] <MacWinner> starfly, so basic replica set config at a minimum? or would you have a higher minimum config?
[18:05:57] <MacWinner> according to the docs, it seems like it's a very simple task to upgrade a replica config to sharding and clustering
[18:08:28] <starfly> MacWinner: from my perspective, a replica set is primarily needed to provide data redundancy and horizontal scaling of reads. In any case, it's not a big deal (assuming outage is OK) to reconfigure into a replica set. Sharding takes more design time to insure you will probably get what you want from it, which is mostly horizontal scaling of writes. Shard key selection is "key," pardon the pun.
[18:09:44] <MacWinner> got it.. thanks!
[18:39:25] <enjawork> hello, i'd like to setup an architecture where i have a "replica" of my production database that i can run aggregations on periodically without interfering with production performance
[18:39:47] <enjawork> is there some way i can use replica sets for this? or do i need to do a custom data pipeline to get data from my production db to my "reporting" db
[18:39:59] <cheeser> you can do aggregations against a secondary
[18:40:19] <enjawork> cheeser: and it will write to the collection in the secondary or in the primary?
[18:40:55] <cheeser> using $out?
[18:41:42] <cheeser> you can only write to a primary. aggregations in 2.4 can only return documents. they can't write to collections, yet.
[18:43:08] <enjawork> cheeser: ooh ok, im confusing myself thanks
[18:43:13] <cheeser> sure
[19:00:58] <ernetas> Hey guys.
[19:01:09] <ernetas> Can I setup a slave replicating a slave?
[19:02:17] <ernetas> I'm getting: " AssertionException trying to slave off of a non-master"
[19:02:24] <ernetas> Maybe I'm doing something wrong?
[19:02:52] <joannac> switch to replication and you can
[19:02:55] <leifw> ernetas: you should probably use replica sets
[19:03:43] <joannac> master slave i believe you can't sync slaves off other slaves
[19:05:06] <ernetas> leifw: can I then control which host is a slave and which is a master? I need to lock this, so I could perform backups...
[19:05:38] <leifw> you can use priority to control which is the primary
[19:06:40] <leifw> and if you want to chain a secondary off another secondary I'm not quite sure how to force that, but if the network ping times suggest that's better I think the other secondary will elect to sync from the first secondary
[19:10:40] <betty> I have a data modeling question (new to mongo). I see my data more as a many-to-one relationship as opposed to a one-to-many. I have a lot of documents (many) that will share common meta-data (one). I'm currently including that meta-data in each document so that I can find these documents by the meta-data properties in a single operation. This will be a common in our queries.
[19:12:00] <betty> I'm interested in any thoughts about why this might be bad. And what an alternative may be. Obviously, it's bad if we ever need to modify the meta-data
[19:12:30] <rafaelhbarros> betty: well, you will just have to change all the documents with that metadata...
[19:13:54] <betty> rafaelhbarros: I maybe be able to live with that, given how unlikely we believe it may be. If it does happen, we're talking about 1600 documents on average.
[19:14:13] <starfly> betty: just continuing embedding if you're OK with updating metadata changes or link (logical join) to a metadata collection
[19:15:08] <rafaelhbarros> betty: 1600 documents is nothing, if you ever have to update that and it's not something realtime it would take a minimum effort
[19:15:51] <betty> rafaelhbarros: that was my hope
[19:17:03] <betty> rafaelhbarros: I do want to index on this metadata
[19:17:45] <rafaelhbarros> well, do index it then
[20:11:30] <Eckardt> anyone have an idea how to directly access the index itself?
[20:24:55] <ernetas> Can I run mongodump on a slave replica set?
[20:26:48] <cheeser> sure
[20:32:50] <ernetas> How? I'm getting "assertion: 13106 nextSafe(): { $err: "not master or secondary; cannot currently read from this replSet member", code: 13436 }"
[20:33:34] <ernetas> Is this because it's a delayed secondary?
[20:38:59] <cheeser> not sure. i've never seen that error
[20:45:45] <joannac> ernetas: is it a slace or a secondary?
[20:45:47] <joannac> slave*
[20:47:38] <ernetas> Damn. Sorry, my terminology is still from MySQL... It should be a secondary (priority=0, hidden=true, delay - 2 hours). What seems to be the problem is that it has been in state STARTUP2 ever since launching. HDD load has calmed down by now.
[20:49:37] <bretep> Hi guys! Anyone have access to the MMS Support jira project? I have an issue open and was hoping for some help.
[20:50:07] <ernetas> I added a clean host to replica set and it should have been syncing, but it does not seem to be... it only allocated space, has been doing some random writes for the past couple of hours and now calmed down... Is there a way to see status of this?
[20:51:16] <joannac> ernetas: okay, so it's not a secondary, hence the message
[20:51:23] <joannac> ernetas: check the mongod log
[20:51:56] <ernetas> What should I be looking for? There are 26000 lines by now.
[20:52:28] <ernetas> Lots of lines about a connection initiated by the primary host, checking for a heartbeat.
[20:53:12] <ernetas> "[rsSync] 12955486 objects cloned so far from collection xxx" - is there a way to see status of this?
[20:53:46] <ernetas> (apart from grepping the log)
[20:54:58] <joannac> grepping the log is it
[20:55:24] <joannac> grep for "[rs" should work
[20:56:18] <ernetas> Thanks.
[21:53:01] <abonilla> Does anyone run an elastic mongodb cluster here? how about private and elastic?
[22:47:23] <hoverbear> Hi all, does Mongoose have race conditions?
[22:47:53] <andrewfree> Can I do querries like this? UserMonth.first.providers.where(:name.in => ["moves","jawbone"]).all.days.where(:date.gte => "2014-03-10").to_a My UserMonth has many providers, providers embeds days
[22:48:01] <andrewfree> hoverbear: Did you ask it?
[22:49:17] <andrewfree> My querry pretty much works if instead of name.in I just use :name and a single "moves" then first.days.where etc...
[22:49:48] <andrewfree> but I'm not sure if there is a way to iterate/move through the two things it should return.
[22:54:34] <ernetas> Seems like I'm stuck at STARTUP2 phase...
[22:55:06] <ernetas> It has been rebuilding index (foreground job from primary) for a multitude of times...
[23:02:55] <hoverbear> andrewfree: ?
[23:03:47] <andrewfree> nvm, not sure
[23:10:10] <joannac> ernetas: it's rebuilding indexes repeatedly? or it's building indexes slowly?
[23:18:44] <alexgr> can i have a javabean extending basicdbobject with getters and setters or its only done through put and get?
[23:20:46] <cheeser> why would you want to extend that?
[23:26:54] <alexgr> cheeser: to have easy conversion to json and from queries no?
[23:27:52] <cheeser> you could just use DBObject directly, then. no reason to subclass.
[23:28:25] <cheeser> but if you want a real, typed java object use something like morphia
[23:29:59] <alexgr> can i use it with java ee glassfish or do i need guice or spring?
[23:30:47] <cheeser> you can and you don't
[23:31:49] <alexgr> thats cool thanks i will look into it
[23:31:59] <alexgr> i am fed up with hibernate-ogm
[23:32:10] <alexgr> it does nothing and it crashes 1/3 times i run it
[23:32:18] <cheeser> yeah. lots of impedance mismatch there.