[03:08:32] <das3in> hi! i'm just getting started with mongodb and am having trouble deciding when to use methods vs statics (http://mongoosejs.com/docs/2.7.x/docs/methods-statics.html) and what the 'cb' argument is
[07:20:25] <liquid-silence> is there a way to update and select the entity?
[07:20:33] <liquid-silence> db.collection("assets").update({ _id: id }, { name: name }, function(err, result) {
[07:20:43] <liquid-silence> result will equal the number of rows affected
[07:21:02] <liquid-silence> so I dont really want to do two db calls
[09:09:30] <acstll> hi there, I got a question regarding handling connections in node.js using the mongojs module:
[09:09:33] <acstll> do I use a singleton instance of a connection for all my application, or should I use a new connection for every other module of my app that needs to perform queries?
[09:13:13] <Nodex> ideally you connect once when your app starts
[09:15:05] <acstll> Nodex: so there's no performance advantage in having 6 or 7 connection (one for each other module) than just 1 for all?
[09:15:33] <acstll> Nodex: I just found this: http://stackoverflow.com/questions/10656574/how-to-manage-mongodb-connections-in-a-nodejs-webapp
[09:16:03] <Nodex> acstll, I am sure that a single connection across 7 apps is not as good as 1 per app
[09:16:23] <Nodex> as far as "module" goes - you wil have to explain your definition of a module
[09:17:55] <acstll> Nodex: by modules I mean just "parts" of my app than handle different routes, there's just one app (node instance), sorry about that
[09:19:08] <Nodex> I recently re-wrote parts of our infrastructure to node + mongo + solr + redis (a common api for dealing with areas / geo / postcodes / reverse geocoding etc) and I connect once at the start - performance is fine
[09:19:21] <Nodex> 3000 - 4000 req/s with no problems
[09:21:29] <acstll> Nodex: perfect, thanks a lot for your help
[09:29:05] <liquid-silence> db.collection("assets").update({ _id: id }, { name: name }, function(err, result) {, can I return the actual updated object instead of the number of affected results
[10:57:34] <dnear> I want to autheticate my mongodb, but i cant do it.. I will get an error in mongod if i want to run it. The error says "dbpath /data/db/ does not exist" How can i fix this?
[11:00:37] <Nodex> create the /data/db path or change the path in your config?
[11:01:07] <bmcgee> Nodex: any ideas about this: https://gist.github.com/brianmcgee/7116279
[11:03:54] <Nomikos> is there a way to findAndModify while also sorting? I want to find the document that was updated least recently and return it after setting status =
[11:04:18] <Nodex> bmcgee : I think that findAndModify is atomic
[11:05:19] <bmcgee> Nodex: that's what I assumed. Since I'm not deleting the old document, but simply updating it with a separate process potentially at the same time it doesn't account for findAndModify returning null.
[11:07:20] <Nodex> if the document is in a locked state then that might account for it
[11:07:38] <cym3try> When i put mongo behind haproxy, i get timeouts - was wondering if haproxy is offcially supported by 10gen
[11:07:41] <Nodex> I am not familair with the ins and outs of findAndModify
[11:07:59] <bmcgee> Nodex: that would suck if it is the case.
[11:08:41] <Nodex> ideally it would return a read only copy of the document but that's probably not efficient for people who expect the -latest- copy
[11:09:04] <Nodex> in that case it shoud retry (imo) the document until it's unlocked and return it - this is speculation though
[11:40:31] <Nodex> you should raise a jira issue that they're wrong then, seems that everyone else would be in the same boat as you
[11:54:36] <scanf> whats the best way to check the localhost machine's mongodb priority? doing lik rs.conf or local.system.replset.members[n].priority forces me to choose an _id
[11:56:51] <scanf> or is there a way to get reliably get my localhost machine's _id, potential workaround :)
[11:59:25] <joannac> rs.status() has self:true for the current node?
[12:09:06] <scanf> joannac: not sure how i can get at that directly from the console with specifying an _id
[12:23:17] <Neptu> I think I know very much the answer but I want to ask does anyone know if mongo treast uuid v1 as oid or just as string...
[12:37:29] <Nodex> Neptu : ObjectId is a bson type it has nothing to do with uuid
[12:39:49] <Neptu> Nodex, just wanted to realize if a uuid on the _id field will be optimized or i have to store it as a binary
[12:43:13] <cheeser> it would stored as a String, iirc
[12:43:23] <cheeser> heh. String. showing my java roots.
[12:57:05] <nicktodd> I'm trying to use aggregate to group by country name and then, for each country, group by number of instances per city in that country group. I've tried using map reduce and aggregate and can get close to it but not how it should be. Any Ideas how I should go about it? Thanks.
[13:21:02] <d0x> Hi, how to add the "index" of a subdocument inside an array to the subdocument itself?
[13:21:39] <d0x> it's hard to google the word "index" with mongodb :)
[13:22:01] <Rhaven> Hello everybody, is there someone knows the impact on datas of draining a shard while my service is running? At what kind of problem should i expect?
[13:41:02] <saml> Rhaven, if you store data in mongodb, you are agreeing to lose your data
[13:47:29] <saml> i haven't used replica set. so from now on, i'll be misleading you. don't listen to me.
[13:47:31] <remonvv> If there's high write contention on that collection (or specifically the chunk being migrated) it will affect performance. In our experience performance is significantly degraded during a drain but I think that's not supposed to be the case.
[13:48:59] <saml> why remove a shard? unless you have really huge database (terabytes) it could be easier to backup, start new cluster on backup and do delta import from old cluster to new cluster.
[13:49:30] <remonvv> And lose all the writes between backup time and recovery time?
[13:55:21] <d0x> I've opened a SO question for this: http://stackoverflow.com/questions/19543459/add-the-index-of-each-array-element-to-the-element-itself
[13:56:21] <Rhaven> saml: sure, it should be great
[14:26:24] <Nodex> run while you can still get a refund :P
[14:29:03] <Rhaven> remonvv: while draining a shard, if there is a write operation on the chunk who is moving to another shard. Is that the changes will be lost?
[14:29:50] <Derick> Rhaven: no, that should not happen
[14:31:46] <Rhaven> Derick: so changes on that chunk will be considered?
[14:34:41] <cheeser> i would think writes to the shard wouldn't happen at all while being drained. i'd think that the new document would be routed to the correct new shard.
[14:35:54] <Derick> that's what I expect as well, but I can't give an authorative answer
[14:39:30] <Rhaven> Ok so all write operations can't happened while the draining is not finished
[14:40:18] <oceanx> hi I have a ~70GB mongodb database in which i stored lot of files using gridfs (through python), I did a mongodump to migrate the database but restoring is taking really a lot time (it's almost 24 hours and still didn't end) is it ok? or there are some issues?
[14:40:39] <cheeser> Rhaven: no. i was talking about writes to the draining shard.
[14:40:52] <cheeser> i can't imagine why the system would write toa shard it's trying to drain.
[14:45:01] <Nodex> oceanx : there are some python tools that someone opensourced for speeding these kind of things up
[14:45:19] <Nodex> the links are on the mongodb blog - it's a write up by a company but I dont recall the name of them
[14:45:33] <Nodex> iirc they're a server monitoring company with a dark website
[14:45:55] <oceanx> thank you Nodex! I'll take a look
[14:48:58] <Nodex> if the name comes to me I'll let you know
[14:51:39] <saml> ObjectID is always 24 characters?
[14:56:07] <saml> GET /articles/<str:_id> and GET /articles/<path:canonicalUrlMinusScheme>>
[14:56:27] <cheeser> you'll need to url encode those parameteres
[14:57:17] <saml> so, /articles/507f191e810c19729de860ea and /articles/nymag.com/daily/intelligencer/2013/10/romney-bookcase-bookshelf-hidden-room-secret.html
[14:57:41] <cheeser> that's not exactly what I said, saml
[15:01:15] <saml> if i used php, i'd cause too many trouble
[15:15:06] <remonvv> Rhaven: Sorry, didn't see your question. Depending on which step of the chunk migration process is active your write will either go to the old shard or the new shard. In the case where it goes to the old shard the writes are automatically replicated on the new shard. This by the way can cause a chunk migration to take very long if the chunk is "hot", meaning there are so many writes to its shard key range that the balancer can never finalize
[15:16:50] <Rhaven> remonvv: Thank you remonvv for reply. that's good to know :)
[16:18:31] <LoonaTick> Hi. I'm trying to setup (as a test) a sharded MongoDB instance on my Windows workstation. I have 3 config servers running on 290179, 29018, 29019 1 mongos running on 27017 and 3 shards running on 25017, 25018, 25019. I don't understand why, but the mongo shards are also listening on 27017, 27018, 27019. Anybody know what I'm doing wrong?
[16:23:32] <hogepodge> ping: any 10Gen folks around?
[16:24:56] <cheeser> well, there are some mongodb folks around...
[16:24:59] <joshua> I guess the technical answer would be no since they renamed to MongoDB
[16:25:28] <remonvv> I wish I had @. Sometimes I just don't feel appreciated enough :(
[16:26:00] <remonvv> What's wrong with "are there any people around somewhat knowledgable about MongoDB that have no problem spending time on my particular problem even though I'm not paying them?"
[16:26:14] <hogepodge> Shows how far behind I am on MongoDB news. :-)
[16:26:29] <remonvv> Well, in all honesty a company rename isn't the most exciting thing ever.
[16:26:53] <remonvv> With the possible exception of them changing their name to "Baby Pink Croissant" or something.
[16:26:58] <joshua> People were probably calling them MongoDB anyway
[16:27:06] <remonvv> Baby Pink Croissant, the creators of the popular database MongoDB...
[16:27:37] <hogepodge> I'm with Puppet Labs. We have a MongoDB module that we were using for one of our projects, but now we're really not maintaining it any more.
[16:29:16] <hogepodge> It's module that has a more general use, though, and before moving it to the OpenStack Stackforge infrastructure for maintenance I wanted to give the MongoDB team a chance to voice opinions about it (like where it's hosted, and so on).
[16:33:42] <hogepodge> Derick: Yeah, I though I should check in here first. Do you know if any MongoDB people are going to be in Hong Kong for the OpenStack Summit?
[16:34:11] <Derick> hogepodge: maybe, I think we have a person there now, but not sure :S
[16:34:47] <Derick> off home, back later if you have further comments/questions
[16:36:31] <hogepodge> Ok, I'll hang out in the channel, or you can e-mail me at chris.hoge at puppet labs.
[16:37:12] <rbento> Hey, anyone was able to install mongodb on OS X Mavericks?
[16:38:22] <hogepodge> remonvv did we kick your puppy or something?
[16:42:30] <joshua> rbento: I haven't tried yet. Are you running into a problem?
[16:43:32] <cheeser> there are ... issues with Mavericks last I heard.
[17:05:23] <ehershey> mongodb installs fine on mavericks :)
[17:05:43] <ehershey> the 2.4 branch just doesn't compile happily
[17:06:13] <eucalyptus> ehershey: you mean the binaries
[17:06:27] <ehershey> rbento: you can use --devel to build 2.5.3, which is unstable, or use http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.4.7.tgz
[17:07:04] <rbento> thanks, I'm doing that right now
[18:36:01] <eph3meral> I'd like to migrate from a relational SQL db (postgres 9.1) to MongoDB. I know this is sort of a "do it yourself" thing for the most part, and I've already started/tried - I just used RABL templates from rails controllers to piece things together and it was really quite simple to bring up, but it's extraordinarily slow and gobbles my ram til I must restart :( are there any/many other reasonable options for doing this that others have u