PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Saturday the 13th of October, 2012

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:40:17] <hdon> hi all :) i've built mongodb from source. installed and working. how do i get the man pages?
[03:01:45] <ArturoVM> Hi everybody, I have a question regarding usage :)
[03:02:59] <ArturoVM> I'd asked it before on SO, but no one gave me a satisfying answer. It's kinda long, so here it is: http://stackoverflow.com/questions/11799953/whats-the-best-practice-for-mongodb-connections-on-node-js
[03:20:41] <ArturoVM> Uhmm…. anybody home?
[03:21:55] <cmplrz> hello
[03:22:02] <ArturoVM> Hi
[03:22:08] <cmplrz> i have newbi question
[03:22:28] <ArturoVM> I do too, but I asked about 20 mins ago and no one answered.
[03:22:42] <cmplrz> ahhh
[03:22:48] <ArturoVM> And before that, I asked about 2 hours ago.
[03:22:50] <cmplrz> i'll ask anyways
[03:22:55] <ArturoVM> And before that I asked about 4 hours ago.
[03:23:14] <ArturoVM> Well go ahead, maybe I can help you out :)
[03:23:25] <cmplrz> how can stop mongodb from printing the _id field
[03:24:23] <cmplrz> {"_id" : "50773a1397cb61f5eddca6d8" , "INTRFCE_NAME" : "inf000"}
[03:24:38] <crudson> cmplrz: exclude it from the find
[03:26:51] <cmplrz> crudson: i used this search db.splnk_inf.find ( { INTRFCE_ID : "0000" }, { "INTRFCE_NAME" : true } );
[03:27:01] <mrpro> 0
[03:27:12] <mrpro> oh
[03:27:15] <mrpro> u cant stop printing ID field
[03:27:17] <crudson> cmplrz: add _id:false to the second arg
[03:27:18] <mrpro> its always gonna be there
[03:27:21] <cmplrz> will _id:false work?
[03:27:23] <crudson> yes
[03:27:29] <mrpro> oh really?
[03:27:30] <cmplrz> ok
[03:27:39] <crudson> give it a whirl :)
[03:27:56] <ArturoVM> Can you guys help me with my question?
[03:28:12] <ArturoVM> It's about connections.
[03:28:17] <crudson> ArturoVM: I haven't used node sorry
[03:28:36] <ArturoVM> Oh ok, well thank you anyway :)
[03:28:47] <cmplrz> not working
[03:28:49] <cmplrz> > db.splnk_inf.find ( { INTRFCE_ID : "0000" }, { "INTRFCE_NAME" : true }, { "_id":false } );
[03:29:01] <cmplrz> still prining _id
[03:29:05] <ArturoVM> mrpro: have you used node?
[03:29:08] <crudson> db.splnk_inf.find ( { INTRFCE_ID : "0000" }, { "INTRFCE_NAME" : true, "_id":false } );
[03:29:31] <crudson> and you don't need the quotes FYI
[03:29:31] <cmplrz> ahh
[03:29:39] <mrpro> Arturo: no. c# mono
[03:30:04] <ArturoVM> mrpro: Alright, well thank you :)
[03:30:16] <crudson> ArturoVM: it's Friday night...so not a lot of people about
[03:30:20] <mrpro> nodeJS is all the rage these days? :)
[03:31:05] <ArturoVM> crudson: Yeah :/
[03:31:30] <ArturoVM> mrpro: Apparently :) I'd rather use Go, but there's no driver for that yet.
[03:31:37] <mrpro> damn
[03:31:40] <mrpro> you like niche stuff ah?
[03:32:02] <cmplrz> crudson
[03:32:13] <cmplrz> crudson:no go
[03:32:39] <mrpro> cmp
[03:32:40] <mrpro> what about 0
[03:32:44] <mrpro> _id: 0
[03:32:55] <ArturoVM> mrpro: Well, I guess you could call it niche right now, but I really hope it gets traction soon. It's an awesome language, have you tried it?
[03:33:08] <mrpro> no cause its slow isnt it
[03:33:12] <cmplrz> mrpro: i il try now
[03:33:23] <mrpro> nodeJS that is
[03:33:43] <ArturoVM> mrpro: Oh no, no, I'm talking about Go. http://golang.org it
[03:33:53] <mrpro> yea i heard about Go
[03:33:57] <ArturoVM> it's super nice. You should try it.
[03:33:59] <mrpro> it came out a while ago and didnt catch on afaik
[03:34:05] <mrpro> c# is win :)
[03:34:12] <cmplrz> not working
[03:34:17] <cmplrz> db.splnk_inf.find ( { INTRFCE_ID : "0000" }, { INTRFCE_NAME : 1, _id:0 } );
[03:34:39] <crudson> http://pastie.org/5049996
[03:34:45] <mrpro> cmp: still get _id? thats what i thought.
[03:35:28] <ArturoVM> mrpro: Yeah, I like C# :) the only problem is that it's .NET, and I really prefer *nix OSes.
[03:35:40] <mrpro> i use Mono on linux
[03:35:43] <mrpro> for c# 4
[03:35:47] <crudson> that paste shows you can exclude _id
[03:35:58] <mrpro> love linq man
[03:35:59] <mrpro> its great
[03:36:25] <cmplrz> what does findOne do, find one record?
[03:36:26] <ArturoVM> Interesting, I didn't know you could use Mono for that kind of thing (MongoDB).
[03:36:53] <crudson> findOne just limits to at most 1 doc
[03:36:58] <crudson> same args as find
[03:37:01] <cmplrz> i c
[03:37:17] <mrpro> Arturo: c# driver works with Mno also
[03:37:30] <mrpro> we develop our solution in visual studio
[03:37:46] <crudson> cmplrz: paste what you are running and what output you are getting
[03:37:47] <mrpro> but when we check code in, our build server bulds it using mono on linux and creates rpm -> deploys
[03:38:01] <cmplrz> k
[03:38:03] <mrpro> all unit/integration tests run on build server to make sure it works well on nix
[03:38:59] <ArturoVM> mrpro: that's great! interesting workflow. I'll have to try that some day.
[03:39:07] <cmplrz> here http://pastie.org/5050003
[03:39:33] <mrpro> arturoVM: cant beat VS2010 :)
[03:39:39] <mrpro> arturo
[03:39:45] <mrpro> on windows tests run using MSUnit
[03:39:55] <mrpro> but when its built for Mono, it uses NUnit
[03:40:39] <hdon> hi guys :) using node.js with node-mongodb-native. is require('mongodb').connect() recommended? i can pass options or a callback, but i can't seem to pass both. where can i find reference for this function?
[03:41:12] <ArturoVM> mrpro: But I just love Go, it's a pleasure writing code with that thing. Plus the standard library is one of the best std libs I've ever seen.
[03:41:18] <ArturoVM> hi hdon :)
[03:41:24] <hdon> ArturoVM, hey :)
[03:41:32] <mrpro> better than .net framework?
[03:41:39] <mrpro> BCL
[03:43:30] <ArturoVM> hdon: is this what you're looking for? http://mongodb.github.com/node-mongodb-native/api-generated/db.html#db-connect
[03:44:46] <crudson> cmplrz: hmm. what is: db.serverBuildInfo().version
[03:44:53] <ArturoVM> mrpro: It's got some really neat low-level stuff, plus some really nice standard things that most languages are missing today out-of-the-box (json & xml parser/serializer, encryption/hashing, http, etc.)
[03:44:58] <hdon> ArturoVM, if require('mongodb').Db.connect() is the same as require('mongodb').connect(), then it's odd that i can't do .connect(url, options, callback) // when i do this, it says it doesn't see the callback :\
[03:45:14] <mrpro> Arturo: ahh
[03:45:34] <ArturoVM> hdon: Hang on, I had some old code lying around with what you need.
[03:45:40] <hdon> ArturoVM, perhaps i made a mistake. also, they are the same function :)
[03:46:00] <hdon> ArturoVM, the problem is that my callback is not being called. i'm investigating why now, perhaps the connection is not being established...
[03:46:08] <cmplrz> crudson: how can I get that
[03:46:12] <ArturoVM> mrpro: yep, only problem is that it doesn't have a GUI lib, but that's ok, there are some GTK+ ports and so on.
[03:46:16] <cmplrz> wait
[03:46:32] <hdon> ArturoVM, oh, hmm... also when i do this, it doesn't see my safe:false option. it complains about me not specifying a safe option.
[03:46:33] <ArturoVM> hdon: yep, are you logging errors?
[03:46:39] <cmplrz> MongoDB shell version: 1.0.1
[03:46:40] <hdon> ArturoVM, on the server?
[03:46:52] <crudson> cmplrz: wondering what server version you are running, if it's an old one
[03:46:53] <ArturoVM> hdon: on your node.js code, to console.
[03:47:28] <hdon> ArturoVM, i see everything on the console, but i'm not seeing any errors yet. perhaps i'm being impatient and SIGINTing before the connection timeout
[03:47:49] <ArturoVM> hdon: hmm, hang on, I'll look for that code.
[03:48:10] <crudson> cmplrz: 1.0.1 is v v v old
[03:48:27] <crudson> cmplrz: I'd get a new build
[03:48:27] <hdon> ArturoVM, this is what i'm doing: http://pastebin.mozilla.org/1865666
[03:50:01] <hdon> ArturoVM, perhaps my problem is different than i thought. right now if i connect from shell, it works. it's not working when i run node in non-interactive mode
[03:50:26] <ArturoVM> hdon: why not just get a db var and then using open()?
[03:50:37] <hdon> ArturoVM, i suppose that's what i'm going to do, thanks :)
[03:50:44] <ArturoVM> I'll put that into a snippet, hang on.
[03:50:47] <hdon> ArturoVM, that seems to be how everyone else does it
[03:51:10] <ArturoVM> Yeah, that's how I do it, but then I ran into some confusing problems :S
[03:51:13] <ArturoVM> http://mongodb.github.com/node-mongodb-native/api-articles/nodekoarticle1.html#getting-that-connection-to-the-database
[03:52:22] <ArturoVM> hdon: which is why I will ask for your opinion, once you get there :) (it might be just me and it's not really that confusing)
[03:53:03] <hdon> ArturoVM, if i connect this way, how do i authenticate?
[03:55:30] <hdon> ArturoVM, it was a connection timeout it looks like :|
[03:55:42] <hdon> something must have changed at the server
[03:56:00] <ArturoVM> hdon: Is it a remote server?
[03:56:31] <hdon> ArturoVM, yes. port 80 is open. 27017 has just been firewalled. lol ugh
[03:57:31] <ArturoVM> hdon: Oh lol, is it yours?
[03:57:42] <cmplrz> crudson: what is the latest versio
[03:58:17] <crudson> cmplrz: 2.2.0 http://www.mongodb.org/downloads
[03:58:26] <hdon> ArturoVM, no, it's someone else's mongo server with a bunch of test data. they began their application in Flask, and so i'm supposed now to use that data as an example of what their mongo documents will look like
[03:58:32] <mrpro> is 2.3.0 gonna be big?
[03:58:47] <hdon> ArturoVM, btw has mongo ever developed a notion of formal document schema?
[03:59:06] <ArturoVM> hdon: Nopes, but theres Mongoose for that.
[03:59:31] <ArturoVM> hdon: http://mongoosejs.com/
[04:00:01] <ArturoVM> hdon: I
[04:00:13] <ArturoVM> hdon: I'm curious, how are you handling connections?
[04:00:33] <ArturoVM> hdon: Are you re-using? Are you putting everything inside the callback?
[04:00:58] <ArturoVM> hdon: here's the question I have, which is precisely regarding that http://stackoverflow.com/questions/11799953/whats-the-best-practice-for-mongodb-connections-on-node-js
[04:02:37] <hdon> ArturoVM, i was going to put everything inside the callback and use auto reconnect option
[04:03:23] <hdon> ArturoVM, let me see if i can find something that shows what i was going to do
[04:03:45] <hdon> ArturoVM, one of the links you gave me has it. http://mongodb.github.com/node-mongodb-native/api-articles/nodekoarticle1.html#getting-that-connection-to-the-database
[04:04:05] <hdon> ArturoVM, it uses auto_reconnect which i hope does what i think it does :) i'll find out soon enough
[04:04:07] <hdon> brb
[04:05:12] <ArturoVM> hdon: Ok, seems reasonable.
[04:19:33] <cmplrz> crudson: need to upgrade database splnk with pdfile v ersion 4.4, new version: 4.5
[04:19:54] <cmplrz> any idea how to upgade the db
[04:20:48] <crudson> cmplrz: I'd google that, I am not sure.
[05:41:21] <tpae> can't backfill array to larger than 1,500,000 elements
[05:41:41] <tpae> what does that mean? it works fine locally, but i get that error when it's on server.
[05:54:13] <crudson> what are you trying to do? what part of your app is creating thing error?
[05:57:41] <tpae> i believe error is from
[05:57:43] <tpae> $this->mongolib->where(array('_id'=>new MongoId($company_id)))->inc(array('usage.'.$today => $num))->update($this->companies_collection);
[05:59:29] <tpae> there's an array called "usage" and was trying to create a key "20121010" date format value, with value of $num
[06:00:32] <crudson> line 836 here http://api.mongodb.org/cplusplus/2.2.0/bsonobjbuilder_8h_source.html
[06:01:50] <tpae> change key to string..? =/
[06:05:20] <tpae> http://www.mongodb.org/display/DOCS/Updating#Updating-%24inc
[06:05:47] <tpae> logic makes sense to me, "increments field by the number value if field is present in the object, otherwise sets field to the number value. This can also be used to decrement by using a negative value."
[06:09:12] <tpae> $today is a string, but i believe it's being sent as int..
[06:09:24] <tpae> which think it's backfilling array
[06:09:32] <tpae> more than 1,500,000 elements
[06:09:35] <tpae> since it's a date format
[06:10:29] <tpae> i tried adding "t" in front
[06:10:30] <tpae> can't append to array using string field name [t20121013]
[06:12:56] <crudson> tpae: sorry I am not familiar with your client language
[06:14:20] <tpae> no problem.. i am not sure whether this is a bug or not.. $inc usage.20121013 returns error
[06:14:29] <tpae> and i tried making it into a string
[06:14:47] <tpae> $inc usage.t20121013
[06:15:03] <crudson> you want to update usage.date by num for docs where _id=$company_id?
[06:15:23] <tpae> yes
[06:16:05] <crudson> you seem to be doing a find, then in, then update (again, not knowing the language). Shouldn't the whole thing be encapsulated within a single operation?
[06:16:31] <tpae> yes
[06:17:22] <tpae> i need to track daily usage of the API
[06:18:10] <crudson> I want to help, but I don't want to lead myself down a road of misunderstanding your language syntax. Just not familiar with that api...sorry.
[06:19:24] <crudson> plus I'm a few deep into the whiskey ;)
[06:19:31] <tpae> heh
[06:19:39] <tpae> i think i solved it
[06:19:55] <crudson> cool. straight mongo, javascript, ruby, I can help with
[11:58:16] <Bilge> Is the count aggregate efficient, or would it be better to maintain your own counter of documents added and removed?
[12:29:24] <kali> Bilge: counts are O(n)
[12:30:17] <kali> Bilge: they should get optimized in 2.3/2.4, if the right refactoring on the indexes happens as expected
[12:49:08] <Bilge> What kind of refactoring?
[13:29:02] <kali> Bilge: https://jira.mongodb.org/browse/SERVER-1752
[16:12:26] <Bilge> Is there a scheduled release date for 2.3?
[16:23:16] <kali> bizzle: 2.3 is a development version. 2.4 is the next production major version, but it won't be there for monthes
[16:23:36] <bizzle> Bilge
[16:24:12] <kali> right. sorry.
[16:24:38] <bizzle> haha no worries, was just lettin him know
[16:42:35] <Bilge> lel
[18:56:36] <nicolaerusan> Hey guys, I'm pretty new to mongo (we use it at large scale where I work, although I haven't interfaced with it myself too much). I'm just starting out on a Rails project, and have opted to use Mongo since it's schema-less nature is fitted for the task at hand: an unknown schema, that should still be query-able. I've started with MongoMapper, and am implementing the authentication at the moment. I've opted to build it from scratch
[18:56:37] <nicolaerusan> rather than using one of the existing gems. I was just wondering if there were any high-level words of wisdom that any of you had in terms of working w/ Rails + Mongo, or if you could point me to any recommended reading.
[22:10:27] <chovy> can anyone access my mongo db?
[22:16:45] <Bilge> Yeah I'm hacking you right now
[22:17:13] <timeturner> lol
[22:21:50] <mrpro> lol
[22:22:47] <chovy> Bilge: i figure that was the problem
[22:22:55] <chovy> switch to couchdb, they are secure
[22:46:15] <Bilge> Switch to MySQL they are most secure
[22:58:59] <timeturner> MySQL is web scale
[22:59:48] <timeturner> MongoDB is only spider scale
[23:21:31] <_cmplrz> hello
[23:23:21] <_cmplrz> what's this? mongodb not secure?
[23:29:45] <_m> Uh… wat?
[23:33:23] <_cmplrz> i upgraded mongodb to 2.2.0 and now I get this in i start mongod
[23:33:25] <_cmplrz> need to upgrade database splnk with pdfile version 4.4, new version: 4.5
[23:33:44] <_cmplrz> splnk is the db name
[23:34:57] <_cmplrz> >run --upgrade to upgrade dbs, then start again<
[23:35:09] <_cmplrz> how can I do that
[23:38:49] <_m> mongod —upgrade
[23:39:05] <_m> (As per the ">run --upgrade to upgrade dbs, then start again<" line)
[23:39:18] <jawr> mongodb rocks \o/
[23:39:32] <_m> mongod —help
[23:39:33] <_m> and
[23:39:35] <_m> man mongod
[23:39:53] <jawr> first project using the c++ driver and it's bliss compared to messing around with a SQL style db
[23:40:10] <_m> jawr: <3
[23:40:37] <_cmplrz> ok thanks
[23:40:42] <_cmplrz> another question
[23:41:33] <_cmplrz> why do to run mongod if i can start the db using mongo <db>
[23:43:12] <_cmplrz> err*
[23:43:23] <_cmplrz> why do I need to start mongod
[23:43:34] <_m> You only need to invoke mongod —upgrade because you upgraded.
[23:43:58] <_m> Otherwise, mongod is a core MongoDB daemon. You are not supposed to call it directly, please refer to the wiki if necessary.
[23:44:12] <_cmplrz> _m: this is separate question
[23:44:23] <_cmplrz> not about the upgrade
[23:44:45] <_cmplrz> i really don't know why I should even start mongod
[23:46:02] <Bilge> derp
[23:46:20] <_cmplrz> _m: i start mongodb using mongo <db>
[23:46:30] <Bilge> I've seen some stupids in my time
[23:46:37] <Bilge> But this guy...
[23:46:44] <_cmplrz> not mongod
[23:47:19] <Bilge> Has anyone ever said to you that you might have learning difficulties?
[23:47:32] <_m> Bilge: Come on now, play nice.
[23:47:34] <_m> mongod is the primary database process that runs on an individual server. mongos is the sharding process. mongo is the administrative shell.
[23:47:50] <_m> http://www.mongodb.org/display/DOCS/Starting+and+Stopping+Mongo
[23:48:01] <_cmplrz> Bilge: who are you talking too
[23:48:34] <_cmplrz> Bilge: whom are you talking about
[23:48:56] <_cmplrz> Bilge: what are you talking about
[23:49:49] <_m> _cmplrz: The last two messages were meant to inform you on *daemon* processes and MongoDB.
[23:52:32] <_cmplrz> _m: thanks, i'm used to *daemon* proceses and I know in geneal that they have to be there before starting the client/child process. That's why I'm surprised that I can run mongo without even starting mongod
[23:53:24] <_m> Please see: man mongo
[23:53:27] <_cmplrz> _m: doesn't really matter to me since It's working but was just cuious
[23:53:42] <_cmplrz> ok
[23:53:52] <_m> It should matter. Inifinitely.
[23:53:57] <_m> *Infinitely.
[23:55:32] <cjhanks> Mongo's cpp client build makes it impossible for me to use -Werror, :(
[23:55:33] <_m> Were I you, I would ask myself why the administrative console works without the daemon when passed a db filename.
[23:55:58] <Bilge> If I were you, I'd ask the administrator why you have access to the console
[23:56:17] <_cmplrz> _m: are saying that to me?
[23:56:33] <_m> _cmplrz: Yes.
[23:56:38] <_m> Bilge: lols
[23:57:30] <_cmplrz> _m : this is my server and i'm playing with mongodb to learn about it
[23:58:03] <_cmplrz> for the first time
[23:59:12] <_cmplrz> _m: i will eventually secure it, i just started last night
[23:59:43] <_m> _cmplrz: That's obvious. I can't help you become a competent sysadmin. The disconnect here is a fundamental gap in linux