PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Wednesday the 12th of September, 2012

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[01:30:43] <Rhaven> there is someone ?
[02:04:20] <cedrichurst> so i know it's possible to add a function to the global scope in mongo's native mapreduce
[02:04:46] <cedrichurst> but is it also possible to do the same thing through the java driver?
[02:45:11] <skot> It is the same way, with a map<string, string>
[04:23:55] <svm_invictvs> Heya
[04:24:17] <svm_invictvs> I was curious, what types should I leave open in Mongo?
[04:25:19] <svm_invictvs> The Mongo object has a close() method, but I assume it's okay to leave that open for the life of the application, no?
[04:25:36] <svm_invictvs> The DBCOllection object doens't seem to have a close() method, do I need to do anyting to properly dispose of that as well?
[07:33:47] <[AD]Turbo> hola
[08:12:27] <NodeX> anyone know off the top of their head the equavilent for "HAVING foo >1" in aggregate framework?
[08:14:14] <NodeX> I need to match then group then match again
[08:15:14] <NodeX> nvm, worked it out ;)
[09:14:03] <Siyfion> Has anyone got any experience with using mongoskin + node.js + Express
[09:14:23] <Siyfion> or just the standard mongo node.js driver for that matter
[09:15:18] <Rhaven> Hello, i'm stuck with some errors in mongos log. especially with "Out of file descriptors" and "Too many open file". I tried to edit /etc/security/limits.conf and restart… but nothing changed
[09:56:12] <Rhaven> did the persistent options in PHP driver works with mongos ?
[10:18:49] <todun_> how to install mongodb on mac osx?
[10:19:04] <todun_> following this: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/#download-mongodb seems to be incomplete
[10:19:39] <todun_> because I cannot run it from the terminal.
[10:35:09] <NodeX> throw your mac in the bin coz they suck
[10:35:23] <NodeX> then rent a server and install it on that :P
[10:37:36] <Zelest> my mac is uber!
[10:37:55] <Gargoyle> todun_: Get homebrew
[10:38:07] <Zelest> is that really needed? o_O
[10:38:19] <todun_> Gargoyle: okay. thanks.
[10:38:25] <Zelest> last time I just downloaded the bins and threw them in /usr/local/bin/
[10:38:38] <Zelest> then started mongod as on any nix
[10:38:38] <Gargoyle> Zelest: It means the install command is "brew install mongodb"
[10:39:10] <Gargoyle> you get a nice fresh compiled copy and the instructions for a proper launchctrl startup
[10:40:15] <kokey> hello, quick question... can one do regex/substring searches on field names, or just contents?
[10:47:37] <todun_> Gargoyle: I tried this when hombrew didn't work: http://shiftcommathree.com/articles/how-to-install-mongodb-on-os-x
[10:48:04] <todun_> now I get this error:
[10:48:27] <todun_> http://pastie.org/4707134
[10:49:07] <todun_> sorry...I get the error when I try to run mongo from the shell
[10:49:38] <Gargoyle> What Mac and OSX version do you have?
[10:49:53] <todun_> mbp 10.6.8
[10:50:03] <todun_> Gargoyle: ^^
[10:51:43] <Gargoyle> todun_: Do you get any errors if you run "sudo launchcrl start org.mongodb.mongod"
[10:52:16] <todun_> I get sudo: launchcrl: command not found
[10:52:38] <Gargoyle> sorry, launchctrl
[10:52:44] <Gargoyle> ahh
[10:52:50] <Gargoyle> *launchctl
[10:53:09] <todun_> Gargoyle: now worries.
[10:53:15] <todun_> no error this time around.
[10:53:24] <todun_> *no
[10:53:33] <Gargoyle> and just running "mongo" connects you?
[10:53:49] <todun_> same error
[10:54:17] <todun_> http://pastie.org/4707170
[10:54:36] <Gargoyle> try "/usr/local/mongodb/bin/mongod --config /usr/local/mongodb/mongod.conf"
[10:55:14] <todun_> I get -bash: /usr/local/mongodb/bin/mongod: No such file or directory
[10:55:34] <Gargoyle> then you didn't install it as per those instructions!
[10:56:05] <todun_> the instructions I followed suggested the following: http://pastie.org/4707185
[10:56:26] <Gargoyle> Hang on!
[10:56:28] <Gargoyle> 1.4!
[10:56:30] <todun_> and I used the 32-bit version not the 64-bit
[10:56:35] <Gargoyle> How old is that!
[10:56:49] <Gargoyle> My advice, get homebrew working.
[10:57:29] <todun_> specifically, this is whatI used: http://pastie.org/4707196
[10:57:45] <todun_> Gargoyle: the first thing I used was brew
[10:57:52] <todun_> it installed but nothing worked.
[10:58:04] <todun_> I followed this tutorial as mentioned earlier:
[10:58:11] <todun_> http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/
[10:58:34] <Gargoyle> OK. Can you run "launchctl start homebrew.mxcl.mongodb"
[10:58:37] <todun_> Gargoyle: I don't mind troubleshooting that. I just don't know how to approach resolving it
[10:59:01] <todun_> I get this error: launchctl start error: No such process
[10:59:19] <Gargoyle> -> "launchctl load homebrew.mxcl.mongodb"
[10:59:42] <Gargoyle> might need .plist on the end of the load command one, not sure
[10:59:44] <todun_> I get this error: aunchctl: Couldn't stat("homebrew.mxcl.mongodb"): No such file or directory
[10:59:44] <todun_> nothing found to load
[10:59:57] <todun_> oops. sorry for the multi-line folks.
[11:00:14] <todun_> I have a plist like this:
[11:00:39] <todun_> http://pastie.org/4707222
[11:01:30] <Gargoyle> What have you got under "/usr/local/Cellar/mongodb"
[11:02:17] <todun_> I have a folder called 2.2.0-x86_64
[11:02:34] <Gargoyle> Well. Your plist does not match mine!
[11:02:51] <Gargoyle> where did you get that plist from?
[11:03:09] <todun_> the tutorial I was following: http://shiftcommathree.com/articles/how-to-install-mongodb-on-os-x
[11:03:33] <Gargoyle> todun_: So you have mixed them up!
[11:03:44] <todun_> okay. how so?
[11:03:52] <Gargoyle> delete that plist
[11:04:19] <todun_> done
[11:04:53] <Gargoyle> Nop copy the correct homebrew one: (cp /usr/local/Cellar/mongodb/2.2.0-x86_64/homebrew.mxcl.mongodb.plist ~/Library/LaunchAgents/)
[11:05:19] <Gargoyle> s/Nop/Now
[11:06:41] <todun_> Gargoyle: I should run http://pastie.org/4707243 ?
[11:06:53] <Gargoyle> yes
[11:07:15] <todun_> done
[11:07:19] <Gargoyle> now: launchctl load homebrew.mxcl.mongodb.plist
[11:08:35] <todun_> http://pastie.org/4707243
[11:08:41] <todun_> was the error I got.
[11:09:47] <Gargoyle> pastebin the output of "ls -lah ~/Library/LaunchAgents/"
[11:10:48] <todun_> Gargoyle: http://pastie.org/4707243
[11:12:11] <Gargoyle> Launch Control is lying to you! :S
[11:12:37] <Gargoyle> I gotta dash! Try a reboot just incase the old one is still loaded.
[11:12:56] <todun_> okay. will do. thanks for all your help Gargoyle
[11:13:32] <Gargoyle> I might have a bit more time later if you're still stuck.
[11:14:15] <todun_> okay. will be here asking away.
[11:14:51] <Rhaven> Hello, i'm stuck with some errors in mongos log. especially with "Out of file descriptors" and "Too many open file". I tried to edit /etc/security/limits.conf and restart… but nothing changed. some ideas ?
[11:17:26] <mm1_> exit
[13:30:29] <NodeX> can $group in the aggregation framework work on 2 fields...
[13:31:27] <NodeX> i/e I have documents with "aid" and "acid" so ... {aid:1, acid:'Campaign 1'} ... {aid:1, acid:'Campaign 2'}
[13:32:11] <kali> NodeX: yes, it does, $group: {_id: { aid: 1, acid: 1 } }
[13:32:24] <kali> or aid: "$aid" ?
[13:32:31] <NodeX> $aid
[13:32:38] <NodeX> brilliant, ty ty
[13:32:39] <kali> NodeX: i managed to get it too work, but i haven't kept the query :)
[13:32:49] <NodeX> wans't sure if I was losing my mind or not
[13:33:12] <kali> btw, i use aid, and cid, but i'm doing exactly the same thing as you :)
[13:33:24] <NodeX> I added a new feature and didn't realise the knock on effect in my aggregatoin lol
[13:33:36] <NodeX> I was going to use "cid" but I use it for other things
[13:33:54] <NodeX> acid = affiliate campaign id
[13:34:18] <kali> ha, ok :)
[13:34:26] <kali> so it's not *exactly* the same thing.
[13:35:59] <NodeX> near enough for what i'm doing
[13:36:10] <NodeX> do you use the framework alot kali ?
[13:37:59] <kali> NodeX: not yet... i've played a bit with it, but i've been over my head about other stuff for a few weeks
[13:38:23] <kali> stuff i need bigger aggregation framework
[13:38:26] <kali> something like hadop
[13:38:32] <kali> hadoop
[13:38:57] <NodeX> I was wondering how you dealt with large data... currently I aggregate into days to make it easier
[13:39:06] <NodeX> *more efficient*
[13:40:11] <kali> for ad tracking, i'm aggeregating stuff on an hourly basis, and push everything in mysql. then i use saiku (a "modern" mondrian frontend) and give that to the marketting guys
[13:40:23] <kali> and it's been quite efficient
[13:40:52] <kali> they're not in my hair every time then want a new count on a new combination of dimensions
[13:42:32] <NodeX> that's good
[13:45:23] <NodeX> I can't get double _id's to work
[13:45:26] <NodeX> [{"$match":{"ymd":20120911}},{"$group":{"_id":{"aid":1,"acid":1}}},{"$sort":{"total":-1}}] <--- no worky
[13:46:06] <kali> or aid: "$aid" ?
[13:46:20] <NodeX> $aid
[13:46:29] <NodeX> I need to group on aid with the Acis
[13:46:33] <NodeX> acid*
[13:46:53] <kali> { $group: { _id: { lang:"$lang", type:"$type", mode:"$mode" }, c:{ $sum: 1} } }
[13:46:58] <kali> this is workinf for me
[13:47:01] <kali> working
[13:47:03] <NodeX> hmm
[13:47:10] <NodeX> I'll try that way
[13:47:19] <NodeX> the docs are very sparse for this sort of thing
[13:47:29] <kali> ha, i've had problems with sparse docs
[13:47:47] <kali> I think the AF still needs some polishing there
[13:48:53] <NodeX> I am trying to write some examples as I build my aggregation functions to help people
[13:50:13] <NodeX> [{"$match":{"ymd":{"$exists":true}}},{"$group":{"_id":{"aid":"$aid","acid":"$acid"},"total":{"$sum":1}}},{"$sort":{"total":-1}}] <----- works, just has the total outside of the results for each one
[13:51:09] <NodeX> bit of appside parsing will sort that out though
[14:08:09] <kokey> can one do substring/regex searches on field names?
[14:08:20] <kokey> I can only see documentation about doing it on field values
[14:10:00] <kokey> e.g. find "admin.users.*smith"
[14:20:05] <IAD> kokey: sounds cool. may be through MapReduce ...
[14:21:26] <NodeX> kokey : I dont think you can
[14:29:45] <IAD> kokey: it's bad idea - save information in field names. Sometimes you'll meet people with the surname "drop database" =)
[14:31:52] <NodeX> kali : for future reference ... you can't use more than one field if you want to use nested elements in $group
[14:32:15] <NodeX> { $group: { _id: { "foo.lang":"$foo.lang", type:"$type", mode:"$mode" }, c:{ $sum: 1} } } <--- would not work
[14:33:01] <kali> NodeX: ha, this is interesting
[14:33:38] <kali> NodeX: thanks for the tip
[14:38:41] <gigo1980> hi in my sharded cluster u start yesterday to remove an shard. the shard hangs on draining one chunk. why ?
[14:41:10] <NodeX> Might be a bug or intended, either way it;s annoying
[14:41:31] <NodeX> sorry, that was not intended at you gigo1980
[14:45:35] <gigo1980> ok
[14:45:57] <gigo1980> in the router log i always get the error that the raining shard is not available
[15:25:32] <gigo1980> sometimes i get an empty result from my map reduce ? why ?
[15:26:50] <ron> because it computes to an empty result.
[15:32:51] <some1else> Hey guys. Is anyone using MongoHQ REST api with Backbone.js?
[15:33:24] <cedrichurst> i am using each of those things independently :)
[15:33:48] <some1else> I'm looking for a place to persist a few odd records with Backbone
[15:34:22] <some1else> It's some data I'm collecting, so it can't be in localStorage. Thought anyone had experience with using the REST API
[15:35:24] <NodeX> redis?
[15:35:29] <some1else> The MongoHQ public repos on github look strangely inactive. Are they still in the game?
[15:37:46] <some1else> NodeX: Strangely, there's a Redis client for ActionScript, but not for client-side JavaScript
[15:38:29] <some1else> Anyway, going to give MongoHQ REST api a shot and let you guys know how it went
[15:38:30] <dr0id> if I update a field in a document, does the actually just update that field all the entire document ?
[15:38:36] <dr0id> field or the*
[15:40:16] <NodeX> clientside?
[15:40:38] <NodeX> oh right sorry, I thought you were using node
[15:41:05] <dr0id> me ? at this moment I am talking about php-mongo
[15:41:30] <dr0id> I think I read somewhere (sometime ago) that mongo updates the entire document (which is more work) - so just curious.
[15:52:39] <Gargoyle> Did something change internally / with php driver that would have just started causing 1/0 to no longer be interpreted as true/false ?
[15:55:46] <IAD> Gargoyle: use can set type in PHP manualy. i.e. $doc['field'] = (string)1;
[15:57:06] <Gargoyle> just wondered if it had changed in 2.2. I think we had mixed values of 0/false and 1/true, but our queries were still giving what we expected. Just had to put in an explicit $or
[15:57:28] <Gargoyle> Could just be some script has changed, and half our docs have been updated though.
[15:58:26] <NodeX> :/
[15:59:06] <NodeX> I havn't noticed anything but I always use 1/0 as ints not bool
[16:03:23] <some1else> Need help finding a persistence API: http://news.ycombinator.com/item?id=4511261
[16:06:35] <Gargoyle> Quick lazyweb answer plz! How do I get console to return all rows and not stop after the first 10/20 ?
[16:12:22] <NodeX> db.foo.find().forEach(printjson); iirc
[16:12:40] <NodeX> though I cannot recall if it stops after the cursor
[16:17:01] <gigo1980> has anyone run mongodb with supervisord for daemonizing ?
[16:53:28] <tfort> don't know if anyone is around right now, but since upgrading to 2.2 from 1.8 I've noticed that a few times a day, I get primary elections that will flap back and forth between servers within 10-20seconds (assuming the heartbeat)
[16:53:50] <tomlikestorock> I've added a server to my replicaset config, but it wasn't able to connect initially. How do I tell the mongo primary to try connecting again?
[16:54:47] <tfort> this appears to be the cause for crashing mongos servers that are in the middle of chunk migration (DBClientCursor::init call() failed)
[16:54:58] <tomlikestorock> er, hm. Seems like I'm getting this: unauthorized: no auth credentials provided for command and authenticated using internal user. This is most likely because you are using an old version of mongos
[16:55:26] <tfort> mongos --version, what's it say tom?
[16:56:26] <tfort> how'd you add the server to the replicaset? you can go to the primary master and just do an rs.add();
[16:56:51] <tomlikestorock> tfort: 2.2.0 on the new box, 2.0.6 on the old ones
[16:56:54] <tomlikestorock> I did rs.add on the primary
[16:56:57] <tomlikestorock> I just found: http://docs.mongodb.org/manual/release-notes/2.2/#upgrading-a-replica-set
[16:57:01] <tfort> yea
[16:57:13] <tomlikestorock> and it says that since I'm running with auth, I need to basically bring the whole thing down, upgrade, then bring it all back up
[16:57:16] <tfort> are you using authentication?
[16:57:22] <tomlikestorock> yeahj
[16:57:38] <tfort> yea, if you're using the authentication you have to follow the upgrade procedure in the release notes
[16:58:26] <tomlikestorock> it says to take down the secondaries, then bring down the primary. Does this mean that at a certain point all of them will be down?
[16:58:52] <tfort> no, you can do a stepdown on the primary
[16:59:04] <tfort> at least that's how I did it
[16:59:21] <tomlikestorock> so bring down the secondary, upgrade it, bring it back up and it should still rejoin the replicaset?
[16:59:26] <tfort> is your mongo instance in production right now?
[16:59:28] <tomlikestorock> yeah
[16:59:58] <tomlikestorock> I am having trouble understanding how a 2.0.6 primary could fail over to a 2.2.0 secondary
[17:00:20] <tfort> If your replica set does not use authentication you may upgrade your replica set in any order, to minimize downtime, use the following procedure:
[17:00:20] <tfort> Upgrade the secondary members of the set one at a time by shutting down the mongod and replacing the 2.0 binary with the 2.2 binary.
[17:00:20] <tfort> Use the rs.stepDown() to step down the primary to allow the normal failover procedure.
[17:00:46] <tomlikestorock> right, but if I do, then I can't do that
[17:00:49] <tfort> you can bring them back up after you upgrade the binary
[17:00:54] <tomlikestorock> because I use auth
[17:42:24] <Vinx> hello all guys, I am newby in mongodb world. I want send in ajax query to mongodb that contains regex. ( http://pastebin.com/qSUriReK )but i always get errors...
[17:43:27] <NodeX> SOP ?
[17:43:34] <NodeX> (same origin policy)?
[17:43:44] <Vinx> ?
[17:44:09] <NodeX> is your orignating script on the same DOMAIN?
[17:44:45] <Vinx> excuse me.. i do not get it.. my javascript in at client side..
[17:44:52] <Vinx> is*
[17:44:56] <NodeX> right lol
[17:45:00] <NodeX> so that's a no then
[17:45:22] <NodeX> you cannot ajax domains that the client is not on unless it's from a localhost
[17:45:30] <NodeX> using file://
[17:45:48] <Vinx> i mean the query without regex is workig
[17:45:52] <Vinx> working*
[17:46:29] <Vinx> if i have a regex in the query is not working anymore.. i suspect it is not really supported by the mongodb HTTP API
[17:46:39] <Gargoyle> Don't regexes need to be in //
[17:48:45] <Vinx> have you ever query using javascript?
[17:49:06] <Vinx> i think i got it.. :) it should be "fault" of my mongodb hosting...
[17:54:12] <Vinx> do you guys know a free hosting with REST API for mongodb?
[18:00:13] <Vinx> thanks anyway.. good bye||
[18:13:43] <jjshabs> hi, is this the appropriate place to ask a couple of questions on the pymongo driver ?
[18:18:00] <jjshabs> i'll target the question a bit better- should a python RLock be placed around an insert on a collection ?
[18:19:35] <tfort> have you looked around on the google group?
[18:21:41] <jjshabs> tfort: good point - looking now :)
[18:57:05] <davertron> I'm trying to use --eval and passing a file at the same time. in my --eval, i set a variable for the shell, but i don't want that to be required (i.e. i want my file to be "runnable" if given a var, but otherwise to just load all the functions). However, when I don't run my command with --eval, i get a reference error since that variable is not defined
[18:58:28] <davertron> here's an example of what i want
[18:58:29] <davertron> https://gist.github.com/3709094
[18:58:55] <davertron> so right now if i run with "mongo dbinfo --eval 'run=true' file.js" it works
[18:59:10] <davertron> but if i try mongo dbinfo file.js --shell, it barfs
[19:25:45] <davertron> well, just in case anyone is curious, to get around the reference error, use something like this
[19:26:09] <davertron> if(typeof varThatMightNotExist !== 'undefined'){ doStuff() };
[20:29:54] <savant> hi all
[20:30:06] <savant> I have a 45 gb collection in mongodb that I would like to destroy
[20:30:25] <savant> is drop atomic, in the sense that it wont incur any system overhead?
[20:30:41] <savant> or will it lock the mongo instance while its removing data
[20:56:52] <wwilkins> Is there a way to get a line number for errors originating from the load() method in the console?
[21:05:08] <a|3x> hi
[21:07:59] <a|3x> is it possible to get a quick estimate on the result count in a large result set without explicitly using count() (i have tried explain() but it is also slow) ?
[21:19:04] <crudson> a|3x: total docs in collection or when passing an attribute query?
[21:25:12] <a|3x> when passing an attribute query
[21:54:26] <sqwishy> You can sort on a field containing arrays in mongo, and it works correctly, right?
[21:57:04] <crudson> a|3x: vote for this https://jira.mongodb.org/browse/SERVER-1752
[23:14:28] <gustonegro> is there anyway to specify in dot notation whether something is an array or object?
[23:15:10] <gustonegro> for exmple, how does mongo know if the 0 in foo.0.bar is an array at index zero or an object with field name "0" ?
[23:28:44] <wwilkins> dot-notation doesn't work like that. You have to use brackets iirc.
[23:32:56] <_m> gustonegro: Seems like a simple enough use-case. Would just try a few locally and find out.
[23:35:21] <_m> wwilkins: db.stuff.findOne({'foo.bar' : 1}) or db.stuff.findOne({'foo.bar.baz' : 0}) would be examples of dot notation in action.
[23:43:11] <gustonegro> _m: yeah, it doesn't matter if you are getting some value with dotnotation. however, if you are creating a value, it seems to always create an object with the number as the field name
[23:43:24] <gustonegro> I'm using mongoose on node...so this might be mongoose specific.
[23:47:13] <_m> Hrm.. Yeah, I would try doing an insert from the mongo shell first to see if the behaviour is the same.
[23:48:15] <_m> Have you tried using push?
[23:48:52] <_m> Thought that wouldn't help for the initial insert… *sigh*
[23:48:56] <_m> *though