[01:51:07] <simon_zhang> i'm not in the office last friday and this monday
[02:19:30] <leaper> Hi, all. Im very new to mongo and i have a question about best practice with collections. Can somebody give me some input / advice on how to break data up into collections?
[02:19:59] <leaper> the data that i have it similar to a web server log filx
[02:20:43] <leaper> EG there are thousands of records that say things like resource X was downloaded by ip I at time T in country C
[02:21:09] <leaper> i need to perform analysis on theese, but only at the resource level
[02:21:22] <leaper> EG: from all of X, perform this calculation
[02:21:38] <leaper> should i dump everything into one collection and put an index on X
[02:21:46] <leaper> or should i create a new collection for each X
[03:49:01] <groundup> I am looking for something similar to https://github.com/thetron/mongoid_token for PHP that I can set my ids to be 5 alphanum characters
[04:19:54] <ak5> hi, can I have mulitple bind_ips ?
[06:25:33] <belak> Are there any good ways of developing with mongodb locally?
[06:26:53] <belak> It seems like almost everywhere I've seen it used, there's been a pretty crazy server running the web and mongo portion... but I don't want mongo using resources all the time
[06:31:24] <apetresc> I'm getting conflicting reports when I try to Google it -- does Mongo's regex syntax support lookaheads/lookbehinds?
[06:35:54] <rpcesar> is it possible to shard over a complex (custom) id using the "hash" type in 2.4? I have an id that itself is a document (comes from a map reduce) and its one of the collections I really need to shard
[07:36:58] <belak> Is there a good way to play with mongo without having a server running all the time
[08:34:00] <remonvv> Anyone particularly familiar with reads through mongos to a repset? I'm running "secondary preferred" tests to repset and it sends all reads to primary.
[08:36:07] <fjay> remonvv: is your replica set healthy?
[08:37:09] <fjay> are you sure from your driver you are setting the secondary prefered properly as well?
[08:37:25] <ron> wait, scratch that. one of you is too much.
[08:39:50] <remonvv> fjay, it is. It was intentionally made unhealthy by killing secondary and then adding it again.
[08:40:04] <remonvv> fjay, after the last step it doesn't switch back to sending reads to SEC
[08:40:42] <fjay> ou mean it worked.. it went unhealthy.. the ncame healthy again... and would no longer read from the sec?
[10:24:36] <double_p> again out of memory. but i dont see "where"/why
[12:02:07] <durre> is "ensure index" a heavy operation on large data sets? is it better to take down the db to maintenance, do the index thing, bring it back up, or can it be run on application start?
[12:22:49] <angelazou> hi, I'm a mongo newbie, just installed it on ubuntu, but I can't get it started
[12:22:56] <angelazou> I got this [initandlisten] exception in initAndListen: 10296 dbpath (/data/db/) does not exist, terminating
[12:25:26] <angelazou> I see that a path is defined in /etc/mongodb.conf
[12:25:37] <angelazou> and the path exists and the folder is owned by mongodb group
[12:26:01] <angelazou> the path is /var/lib/mongodb
[12:26:12] <angelazou> but why does the error message say it's /data/db?
[12:28:26] <Number6> angelazou: How did you install it?
[12:39:07] <Number6> angelazou: That's expected. Run the apt-get clean afterwards and then install the 10gen-mongodb package
[12:39:57] <angelazou> sigh...download the 200MB again...why couldn't they get a cache for this...?
[12:41:13] <Number6> You'd have to download the package anyway - it's a new repo. Even if it wasn't, MongoDB doesn't ship with a base Linux install... yet :-)
[12:41:43] <angelazou> Tue May 28 20:41:23.711 JavaScript execution failed: Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:L112
[12:42:48] <angelazou> the directory has been created in /var/lib/mongodb
[12:44:37] <angelazou> I tried do a repair and journaling, but I got Tue May 28 20:43:56.736 [initandlisten] ERROR: listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:27017
[12:46:43] <angelazou> number6: I tried restarting mongodb and now it's stuck at Tue May 28 20:44:40.357 [websvr] admin web console waiting for connections on port 28017
[12:48:36] <Number6> angelazou: what does $ps auxf | grep mongo show?
[13:51:33] <Gargoyle> If you follow the instructions to use the 10gen repo, then you'll get more up to date versions.
[13:52:31] <pabbie> I apologize in advance for all nebbish questions I will be asking here :D Im doing my internship on a company which except greatness from me but I'm new to all of this lol
[14:11:33] <Gargoyle> pabbie: curl (and it's simpler cousin, wget) are command line tools for downloading the contents of URLs.
[14:11:35] <Number6> Yeah, that is the non-specific Linux install instructions. For RHEL / CentOS / Ubuntu and Debian there are dedicated repos you can use - makes life far easier for a Sysadmin
[14:13:30] <pabbie> I guys are waaay more helpful than people in the node.js chat. so thanks a lot for that =)
[14:16:39] <starfly> pabbie: we're paid by the byte! ;)
[14:43:54] <Number6> OpenVZ and MongoDB don't really work well together, as OpenVZ does interesting things with memory management
[14:44:15] <pabbie> which ones are common? I might recognize it if you mention it
[14:45:00] <Number6> Xen and KVM are the most common, followed by OpenVZ (also called Virtuozzo / Parallels / Any mention of Plesk)
[14:46:37] <Number6> OpenVZ VMs are, generally, cheaper to rent than Xen because of the memory management and cpu sharing of the hypervisor, so people flock to them thinking they will be ideal... they never are
[14:47:57] <pabbie> agh I see, actually never heard of any of those…or the term itself
[14:48:30] <pabbie> Im working on that example…as you can see on that link ^
[14:48:30] <pabbie> is it supposed to look like this? http://knowlisher.com:3000/wines
[15:35:38] <hjrnunes> is it possible to use the cursor.min / max with pymongo? I'm trying to get around https://jira.mongodb.org/browse/SERVER-8135 but I can't use the array solution as I'm already indexing an array for that query
[15:43:04] <hjrnunes> is it possible to use the cursor.min / max with pymongo? I'm trying to get around https://jira.mongodb.org/browse/SERVER-8135 but I can't use the array solution as I'm already indexing an array for that query
[16:02:20] <hjrnunes> is it possible to use the cursor.min / max with pymongo? I'm trying to get around https://jira.mongodb.org/browse/SERVER-8135 but I can't use the array solution as I'm already indexing an array for that query
[16:21:34] <pabbie> hi! well I've followed this guide http://coenraets.org/blog/2012/10/creating-a-rest-api-using-node-js-express-and-mongodb/
[16:21:44] <pabbie> and now I want to post data to the mongoDB from a simple html page
[16:21:54] <pabbie> but I don't know how to, any help? please
[16:26:50] <pabbie> I did all thats on there and got this output: http://knowlisher.com:3000/wines/ which I assume is correct
[16:32:03] <Gargoyle_> pabbie: Looks good. But I'm not a nodejs user.
[16:34:05] <pabbie> gargoyle_ see I'm not even sure I need to be using it anymore…now that using mongoDB. it was needed before when I was planning to use a mysql database
[16:35:05] <Gargoyle_> pabbie: Only you can know that. Depending on your app.
[16:36:00] <pabbie> gargoyle_ if I wanted to post data to this example I just made…from a simple html page. Would that be possible?
[16:37:06] <Gargoyle_> Having a very quick look down the tutorial, If you have reached the bottom, I would say yes.
[16:37:31] <pabbie> gargoyle_ the whole reason why I'm trying this because I have this simple webpage that needs somewhere to storeData..and then later has to be able to retrieve. I've been told to try so many things my head is spinning! lol
[16:38:03] <pabbie> gargoyle_ yeah but using cUrl…whats that? gahhh! haha :P
[16:38:17] <Gargoyle_> pabbie: If you just need to simply store and retrieve, then you probably don't need an API.
[16:38:41] <Gargoyle_> Unless you need to provide that storage and retreval functionality to other programs.
[16:39:14] <hjrnunes> Hi everyone, is it possible to use the cursor.min / max with pymongo? I'm trying to get around https://jira.mongodb.org/browse/SERVER-8135 but I can't use the array solution as I'm already indexing an array for that query
[16:40:58] <pabbie> gargoyle_ no it will only be needed for that one website. So what do you suggest? Whats the easier way to get this done? =)
[16:42:17] <Gargoyle_> If you are using node.js to write your website, then that tut has already shown you how to store and fetch from mongo. I have no idea what else is a good starting poing for a node.js powered website.
[16:44:03] <pabbie> gargoyle_ the website isn't written in node.js . Node just entered the equation yesterday. Also, that tutorial didn't how hot to store, did it?
[16:45:18] <Gargoyle_> pabbie: What server side programming do you know?
[16:47:11] <pabbie> gargoyle_ well thats the thing. I know some php and asp.net but the website is built in javascript…so thats what I have to use
[16:48:14] <Gargoyle_> Right. So that's probably where the API adea has come from. As javascript is run in the browser, so that is external to your server-side stuff.
[16:48:35] <Gargoyle_> The node.js example you are following *IS* your server-side.
[16:48:50] <Gargoyle_> Keep following the tutorial.
[16:49:00] <pabbie> btw, thank you so much for putting up with me haha =P
[16:49:47] <pabbie> didn't I do the whole tutorial? lol…I've must have missed something
[16:50:40] <Gargoyle_> pabbie: You can find some excellent info on building and testing API's on this blog:- http://www.lornajane.net/?s=curl&submit=Search
[17:00:37] <EricL> Are Mongos instances just "dumb" proxies or do they hold a buffer?
[17:02:42] <aidanie> I have an attribute "count" which holds an integer, how do I query the database to only return N documents with the greatest count value?
[17:03:08] <Gargoyle_> aidanie: Order by count, and limit.
[17:14:01] <hjrnunes> Hi everyone, is it possible to use the cursor.min / max with pymongo? I'm trying to get around https://jira.mongodb.org/browse/SERVER-8135 but I can't use the array solution as I'm already indexing an array for that query
[19:08:11] <OliverJAsh> Is there anybody who can offer me advice for optimising the data model for my application? Some of the queries I'm currently doing are very expensive. I would have phrased this as a more direct question but I really just need to describe my current model in full to somebody, but I really need an expert.
[19:08:32] <OliverJAsh> I've watched and read lots of schema design. I'm not a n00b :)
[19:24:30] <pabbie> whats nebbish I wonder..hmmm...
[19:25:56] <pabbie> has anyone of you seen that wine cellar example that makes use of mongoDB? http://nodecellar.coenraets.org
[20:00:44] <kobigurk> regarding Azure on MongoDB - I want to use the RoleEnvironment.Changed event and reconfigure mongo as to the number of replica members existing there. It's relativly simply - is there any reason it wasn't implemented? Am I missing something?
[20:07:52] <starfly> pabbie: I just tried that site, added a fave wine, but it doesn't show up when browsing--guess result set is limited
[20:09:00] <pabbie> starkly hi! yeah I think its limited on there so it doesn't get flooded by ppl who try it out. But my local copy should work but it doesn't =( http://knowlisher.com/cvkeeper/latest/nodecellar/public/
[20:14:45] <starfly> pabbie: break down each piece of the app to debug; most of us (flying blind) would have to be on your server to do that, but just go through each app function and make sure (by, for example, stubbing out debug statements that display variables), make sure you're constructing proper JSON by taking it from the debug info and run it directly in the MongoDB database (mongo shell), etc.
[20:18:10] <pabbie> I'm confused as the wines list is way more populated than this… but this only returns 2! hmm http://knowlisher.com:3000/wines
[20:27:01] <starfly> pabbie: from doing a few curls of the source site and your site, I think you just have to position the app related directories correctly under the root (getting 404 errors on JS references in your site)
[20:28:22] <pabbie> oh..seems pretty straight forward then hehe. starfly, I really appreciate you taking the time to help me :) I really do
[21:19:12] <dw_> ahoy. is it possible to configure mongo (during a query or otherwise) to fail the request if an index is missing (or scan of large table required, etc)
[21:19:46] <dw_> alternatively, is it possible to have mongo suggest indices based on e.g. a load test
[21:40:03] <skram> Hey Guys. I have a question. Im trying to figure out how many new documents im getting per hour on a collection. Ive been looking into the aggregation framework with no luck. Any insight?
[21:47:35] <crudson> skram: what have you tried so far?
[21:49:04] <skram> crudson: i came up with this; db.signups.aggregate( { $match : { time: { $gte: ISODate('2013-05-20 00:00:00'),$lt: ISODate('2013-05-28 00:00:00') }}},{ $group : { _id : null , averagePerDay : { $avg : "$count" } } } )
[21:52:03] <skram> crudson: which im sure is horribly wrong.
[21:53:23] <kurtis> Hey guys, can anyone show me an example of doing an upsert in Python? I'm not sure if simply setting the query to { '_id': None } is working. Testing directly in Mongo (with null, intead of None) set the ID to NULL
[21:53:34] <crudson> skram: Just to clarify, you are query a week's worth and you want? per hour or per day counts? or averages?
[21:54:59] <skram> A week's worth, per hour. That was just to get it working. But, to be simple i wouldnt mind a per hour average within a 24 hour period
[21:55:15] <skram> Just to get something working, I should be able to figure the rest out once I can get something.
[21:56:12] <crudson> skram: let me put something together in between setting off some tasks here - I could do with a refresher on how to do it so will come up with a solution (I hope)
[21:56:46] <skram> Awesome. Thanks man, I really appreciate it.
[22:05:18] <crudson> skram: how long you on for? I have to get out a couple of things for real work for a few mins.
[22:05:50] <skram> ill be on for a while, just ping me or send me a DM.
[22:37:56] <crudson> skram: ok - creating a paste for you, one min
[22:43:17] <shulmang> I'm currently reviewing docs regarding write concerns for replica sets and am wondering if anybody has any familiarity with the details of the implementation for majority write acknowledgement. Is it just a simple majority or some other logic?
[22:46:22] <crudson> skram: http://pastie.org/7977190 - that will give documents per day or per hour for a given range. Let me know if it's on the right track.
[22:48:53] <crudson> Note that to handle crossing a year boundary you'll have to add $year to the $project
[23:13:05] <crudson> skram: bit simpler http://pastie.org/7977270 - it's more sensible to just combine the keys in the group _id
[23:22:27] <skram> crudson: working on converting to php
[23:42:47] <crudson> skram: if you wanted to have them sorted chronologically and have year/month/day(/hour) instead of dayOfYear, which is probably preferable, and attributes at top level instead of in _id, use http://pastie.org/7977361 . that should do, back to work :)