PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Tuesday the 5th of February, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:15:07] <prophit> If I have documents with variable numbers of keys, how can I get a list of the keys on the document? or a count of the number of keys?
[04:08:57] <prophit> if I have a collection with docs like {id: 'somekey', count: 4}, how can I use the aggregation framework to compute the average count?
[08:39:01] <[AD]Turbo> hola
[08:42:13] <ethanol> how can I control how many child processes mongodb parent spawns?
[08:42:20] <ethanol> I couldn't find anything about this in config documentation
[08:42:40] <ethanol> it spawns like 9 of them, whilst I could probably do with 1 or 2 :/
[14:41:57] <lfamorim> Hello!
[14:42:07] <lfamorim> How could I change a DBRef collection?
[14:42:19] <lfamorim> just the collection
[15:37:07] <andreligne> Hi! I have a question regarding using mongodb with nodejs :)
[15:38:09] <NodeX> better to just ask than ask to ask
[15:39:01] <andreligne> True
[15:39:33] <andreligne> I'm wondering if it's a good idea to have all the database-requests in one "controller"-file and then use this within all other controllers
[16:04:19] <ethanol> can someone point me at where in the documentation it describes how to reduce the number of child processes mongodb spawns at startup?
[16:34:04] <flock3> Hey guys, I have some data in this format: http://pastie.org/6064047 I think I need to do $pushAll to append the event_alerts key to something like this: http://pastie.org/6064154 - how do I format this?
[16:50:12] <NodeX> $pushAll :{599 : Object}
[16:50:23] <NodeX> $pushAll :{"599" : Object}
[16:50:49] <Killerguy> hi, does the nagios plugin to monitor mongo cluster works well?
[16:50:57] <Killerguy> does someone got any advise about it?
[16:53:37] <tom0815> hi killerguy, I used the mongodb plugins for a few month and they are doing their work
[16:54:44] <owen1> indexes questions - i have a find by user_id and app_id. does it mean i should have compound index?
[16:55:22] <tom0815> of cause most work is to adjust the params of the nagios plugins to match your setup
[16:55:22] <NodeX> yes
[16:55:28] <vlad-paiu> Hello. have some weird issue with mongodb.. in the CLI I do something like db.col.insert({ "version": 4, "name": "address"}) , and then I fetch the record from with the C driver, but I get the 4 value as a BSON_DOUBLE instead of a BSON_INT ... is that expecting, or am I inserting it wrong..
[16:55:38] <NodeX> compound index on user_id, app_id
[16:55:49] <owen1> NodeX: i also have an upsert based on app_id and device_id. what does that mean in regards to indexes?
[16:56:12] <kali> vlad-paiu: you need to make the types explicit in the shell, as js is not typed
[16:56:22] <NodeX> does app_id
[16:56:32] <NodeX> + device_id get used for anything else?
[16:56:44] <kali> vlad-paiu: http://docs.mongodb.org/manual/core/shell-types/
[16:57:04] <owen1> NodeX: let me see
[16:57:26] <NodeX> you'll want an extra index for it unless it's not an important upsert
[16:59:02] <owen1> NodeX: i don't really use the app_id + device_id for anything but that upsert. the main thing is the find (user+app)
[16:59:27] <Killerguy> ok tom0815 thx
[16:59:28] <NodeX> owen1 : it will depend on what you're app tollerance is like for a slow upsert
[16:59:37] <Killerguy> with a cluster about 100shard it will works?
[16:59:42] <vlad-paiu> kali: ok, got you. thanks, worked
[16:59:43] <NodeX> personaly I would add the index
[17:00:25] <owen1> NodeX: so user+app is %100 needed, and maybe also device?
[17:00:48] <NodeX> device wont get to use it
[17:01:29] <owen1> NodeX: when u said "I would add the index". what indexes did u meant?
[17:04:36] <NodeX> both
[17:05:25] <owen1> NodeX: ok. user+app but no need for user+app+devices. thanks!
[17:07:26] <NodeX> user+app+device will never get used
[17:26:38] <alexwaters> does anyone know how I can remove just one document with pymongo? can i do monDB['collection'].remove({'orderid':'123'}, True, Safe=True)
[17:27:48] <alexwaters> also, the docs says remove safe is deprecated and I should use w. Anyone have docs on how I should be checking that critical write/remove commands were successfully processed?
[18:00:29] <vlad-paiu> Hi. Another C question, if anybody's around.. is there an easy way to determine how many 'rows' a cursor has in the mongoDB C library ? Is it safe to save the initial cursor, then iterate with mongo_cursor_next() until no more rows left, and then start from the beggining with the initial cursor ? or will this mess something around in the mongo C library internals ? :)
[18:07:50] <vlad-paiu> tried above, and didn't work. not sure if it's the library's intended way of working, but did m_cursor->reply->fields.num which seems to return the correct value
[18:24:37] <Killerguy> how can I know if my balancer is working too much?
[18:24:57] <Killerguy> I mean, I want to know if my shard key is good enought to shard properly
[18:27:09] <jmpf> I have a secondary that is *way* behind a primary but rs.status() indicates otherwise - wanting to run repairDatabase on the secondary, then demote primary and do the same - is that going to be a problem?
[19:18:23] <nb-ben> using the JavaScript driver, calling collection.find( ... ) does not require a callback? or does the toArray( function() {}) call actually perform the query and calls its callback after fetching the results ?
[19:19:17] <beandip> Anyone here using the edelight cookbook for mongodb?
[19:20:00] <beandip> I'm running into errors getting it to load in a vagrant/chef-solo wondering if anyone here has this running that I can bounce some questions off
[19:28:43] <tubbo> hey guys, does Mongo lock when you write to the DB?
[19:28:48] <tubbo> (like *SQL stuffs?)
[19:29:19] <ron> Yes.
[19:43:47] <tubbo> ok
[19:47:30] <Garito> hi, all!
[19:48:49] <Garito> may I ask about aggregation framework here?
[19:50:39] <Garito> hello?
[19:50:49] <Garito> 358 users and nobody say anything
[19:50:51] <Garito> ?
[19:51:02] <mr_smith> don't ask to ask. just ask.
[19:51:08] <Garito> sure
[19:51:23] <Garito> need to count when a field ends with a concrete substring
[19:51:30] <Garito> how can i do that?
[19:51:43] <Garito> I have this
[19:51:44] <Garito> pyExpr:{
[19:51:44] <Garito> '$match': {
[19:51:44] <Garito> 'time': {
[19:51:44] <Garito> '$gte': utilsFecha['esFecha']('%sT00:00:00Z' % path('Yanged/yQueryString/Inicio/0')),
[19:51:44] <Garito> '$lt' : utilsFecha['esFecha']('%sT23:59:59Z' % path('Yanged/yQueryString/Fin/0'))
[19:52:10] <Garito> it works ok
[19:52:11] <mr_smith> use a pastebin.
[19:52:19] <Garito> but now I need to add the counting
[19:52:20] <Garito> sorrey
[19:52:22] <Garito> sorry
[19:52:43] <Garito> http://pastebin.com/PDarGg7n
[19:52:53] <Garito> I have this aggregation project
[19:53:04] <Garito> who count me the number of visits
[19:53:13] <Garito> with the ones with authenticated users
[19:53:29] <Garito> now I would like to add when the visit ends with a substring
[19:53:33] <mr_smith> i would think your $group was counting correctly.
[19:53:33] <Garito> in the same project
[19:53:43] <Garito> yes
[19:53:45] <Garito> it works ok
[19:53:51] <Garito> what I need is to add
[19:53:54] <Garito> another counter
[19:54:07] <Garito> to count the visists who ends with a substring
[19:54:18] <Garito> but I can't find the correct one
[19:54:23] <mr_smith> not sure how to do that. sounds like a separate aggregation.
[19:54:32] <Garito> yeah
[19:54:38] <Garito> I could do in this way
[19:54:51] <mr_smith> but if that's what you're doing, you could use a $match with a regex.
[19:54:53] <Garito> but then I need to find 2 times the same information
[19:55:08] <Garito> in a different project I could
[19:55:25] <Garito> but i don't want to visit the whole table again
[19:55:33] <Garito> for making another counting
[19:55:42] <Garito> sounds very bad
[19:56:02] <mr_smith> how often are you running these queries?
[19:56:08] <Garito> on demand
[19:56:31] <Garito> will be part of an ecommerce dashboard
[19:56:40] <Garito> want to count:
[19:56:40] <Garito> visits
[19:56:48] <Garito> authenticated users from this visits
[19:56:55] <Garito> checkouts
[19:57:01] <Garito> etc
[19:57:24] <NodeX> what
[19:57:25] <NodeX> are
[19:57:27] <NodeX> you
[19:57:29] <NodeX> trying to
[19:57:30] <NodeX> do
[19:57:43] <Garito> an ecommerce dashboard
[19:57:46] <mr_smith> don't encourage him.
[19:58:33] <Garito> so?
[19:58:37] <Garito> what do you think?
[19:58:50] <NodeX> think a out what?
[19:58:54] <NodeX> aboout*
[19:59:43] <andybons> would someone mind explaining to me why an aggregation result set's length would be different than the result once its been run through { $group: { count: $sum: 1}} ?
[19:59:57] <Garito> I think in a conditional with a regex
[20:00:05] <Garito> will this be possible?
[20:00:11] <mr_smith> i think you have a number of options, but i'm pretty sure you're going to have to do multiple aggregations. if you're worried about load, you can query secondaries or cron the queries every 5 minutes and cache the results.
[20:00:29] <Garito> shit!
[20:00:44] <Garito> I was thinking that aggregation make this posible
[20:00:55] <Garito> am I correct?
[20:01:41] <Garito> If not aggregation isn't useful
[20:01:46] <mr_smith> so you want to do multiple matches with independent counts in a single aggregation pipeline?
[20:01:58] <Garito> I'm doing it right now
[20:02:07] <mr_smith> then why are you asking?
[20:02:12] <Garito> with visits vs authenticated users
[20:02:22] <Garito> because I need another count with a reges
[20:02:25] <Garito> regex
[20:02:27] <NodeX> personaly I aggregate every X mins and reduce down into different collections... ths is the best way to d near realtime aggregation
[20:02:41] <mr_smith> and i'm +1 with NodeX
[20:03:19] <Garito> so mongo does not make this aggregations?
[20:03:36] <NodeX> mine?
[20:03:37] <NodeX> yes
[20:03:46] <Garito> at least on demand
[20:03:54] <NodeX> on demand is a bad idea
[20:04:15] <Garito> fuck any other database make this possible
[20:04:26] <NodeX> then use another database ;)
[20:05:40] <Garito> really?
[20:07:56] <NodeX> why are you using mongo for this?
[20:08:17] <Garito> I like nosql schemaless
[20:08:32] <NodeX> then you'll have to work in it's bounds
[20:09:01] <Garito> don't seems to me so big deal what i need
[20:09:13] <Garito> seems to me a normal operation
[20:09:40] <NodeX> realtime aggregations?
[20:09:49] <Garito> yeah
[20:10:08] <Garito> counting visits
[20:10:13] <NodeX> upto about 50k rows on a 16gb ram quad core it's fine
[20:10:25] <NodeX> s/rows/documents
[20:11:24] <mr_smith> unless you're amazon, i can't imagine performing multiple aggregations is a problem.
[20:11:37] <Garito> oh man!
[20:11:52] <Garito> I need to count in the same time period several things
[20:11:52] <NodeX> the locks end up being the proble
[20:11:57] <NodeX> +m
[20:12:12] <Garito> and you aks me to make several aggregations
[20:12:27] <Garito> same time period is the key
[20:12:32] <NodeX> you asked us
[20:12:38] <mr_smith> NodeX: i thought only writes lockd.
[20:12:45] <Garito> need to read again and again the same info to aggregate different things
[20:12:51] <Garito> sounds crazy for me
[20:13:05] <NodeX> database level locking
[20:14:20] <mr_smith> NodeX: okay i'm with you. could just hit a secondary.
[20:14:53] <NodeX> no point, just do what I originaly said and aggregate every X mins
[20:15:20] <Garito> ok
[20:15:21] <mr_smith> i'm fine with that too and that's how i'd solve it.
[20:15:30] <Garito> end way there
[20:15:36] <Garito> in my opinion
[20:15:44] <Garito> I wonder what you said
[20:15:49] <Garito> but i have to accept
[20:15:51] <Garito> it
[20:15:56] <NodeX> I dont
[20:15:58] <NodeX> understand
[20:16:00] <NodeX> a
[20:16:03] <NodeX> word you justy
[20:16:05] <NodeX> said
[20:16:21] <Garito> thanks
[20:16:25] <Garito> and see ya
[20:16:34] <NodeX> good luck :)
[20:16:54] <mr_smith> phew
[20:17:41] <kali> :)
[20:17:47] <mr_smith> yeah, but how else are you going to get WEBSCALE!
[20:18:13] <NodeX> rdbms without joins
[20:18:20] <NodeX> and a large cache
[20:18:30] <mr_smith> that doesn't improve anyone's resume.
[20:28:18] <NodeX> +1
[21:01:15] <owen1> i want to add a compound index - app_id and user_id. i only have 3 types of apps. does it mean the user_id should be the first index and the app_id second?
[21:01:27] <saml> how can I saerch for documents that has a sub document (nest level not known) with a key val header_size: 2 ?
[21:01:33] <owen1> (i'll have many user ids)
[22:14:45] <sfa> has anybody used the "mongodb" driver in Node.JS?
[22:15:39] <someprimetime1> aka used mongodb with node.js?
[22:15:47] <sfa> yup
[22:16:23] <sfa> I'm having trouble with doing an "npm install mongodb" ... It is complaining about "pre" versions cannot be installed
[22:16:29] <someprimetime1> sudo
[22:16:37] <someprimetime1> wait
[22:16:42] <someprimetime1> are the requests just not going through?
[22:16:46] <someprimetime1> paste the error
[22:16:52] <sfa> k one sec
[22:17:11] <someprimetime1> normally I `sudo npm install mongodb`
[22:17:35] <sfa> http://pastebin.com/kreSdDtz
[22:18:22] <sfa> let me try sudo
[22:18:38] <sfa> same thing with sudo
[22:18:39] <someprimetime1> yeah
[22:18:44] <someprimetime1> that's only if it won't GET it
[22:18:51] <someprimetime1> hm looks like you have a previous version it's conflicting with maybe?
[22:19:01] <someprimetime1> what happens when you type `mongod` in the cmd prompt
[22:19:17] <someprimetime1> are you on a linux machine?
[22:19:27] <sfa> yes it's a linux machine
[22:19:44] <sfa> and this machine doesn't have mongo installed on it.
[22:21:59] <someprimetime1> try asking in #node.js
[22:22:05] <someprimetime1> I'm not sure tbh
[22:22:19] <sfa> okay thanks for helping someprimetime1
[22:22:21] <sfa> :)
[23:19:48] <solidus-lake> whoa, mongod doesnt have a —config option anymore?
[23:19:49] <solidus-lake> what the hell
[23:19:55] <solidus-lake> so how are we supposed to deploy different configs
[23:20:05] <solidus-lake> a long param list manually in the init file :?
[23:38:58] <solidus-lake> hmm
[23:39:01] <solidus-lake> so i started my master
[23:39:09] <solidus-lake> i started the slave and told it of the master
[23:39:12] <solidus-lake> how do i start an arbiter
[23:40:47] <owen1> i want to add a compound index - app_id and user_id. i only have 3 different apps ids. does it mean the user_id should be the first index and the app_id second?