PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Tuesday the 28th of May, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:23:24] <volitek> Is using mongo suitable for dealing with money?
[00:31:21] <merpnderp> Are these valid criticisms of mongodb? http://en.wikipedia.org/wiki/MongoDB#Criticism
[01:49:41] <simon_zhang> deniz
[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:05] <leaper> log file*
[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
[07:37:02] <belak> ?
[07:39:55] <kali> starting a server when you want to play with it ?
[07:49:28] <balboah> :)
[07:49:42] <balboah> run it local on your workstation?
[07:50:55] <double_p> port foobar.. do not try to mongorestore via the REST interface - fails "interestingly" =)
[08:02:54] <belak> balboah: doesn't it like eating a lot of disk space?
[08:09:57] <balboah> belak: depends on how much data you put in there :)
[08:10:13] <balboah> expect a couple of GB
[08:11:16] <belak> balboah: I thought mongo preallocated like a 10th of your hd space.... or am I thinking of something else?
[08:12:50] <balboah> it preallocates like 2G at a time
[08:13:15] <balboah> you can also run in a virtual box
[08:13:21] <balboah> it likes to map all your ram
[08:13:55] <belak> Fun.
[08:16:46] <nicolaas_> belak https://mongolab.com/welcome/ offers free Mongo databases (<500Mo) ... it's a very good start
[08:17:09] <nicolaas_> and quite easy to set up
[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?
[08:40:47] <fjay> after it came back?
[08:41:00] <remonvv> fjay, right. It's a lab test. No writes, no oplog lag.
[08:41:14] <fjay> how many servers in your replica set?
[08:41:17] <remonvv> 3
[08:41:21] <remonvv> pri, sec, arb
[08:41:32] <fjay> interesting
[08:41:47] <fjay> i've not seen that behaviour
[08:41:52] <remonvv> I rather thought so. I assumed it was a driver bug until I realised it's mongos that's doing the routing atm.
[08:41:58] <fjay> but all our replica sets are 5 members
[08:42:03] <fjay> 4 data and a arb
[08:42:17] <remonvv> Right. I can try without mongos and see if that changes anything.
[08:42:23] <remonvv> Go straight to the nodes.
[08:42:41] <fjay> what driver?
[08:43:08] <fjay> actually wait no that makes little sense if mongos is involved
[08:43:39] <fjay> shit is it really 1:40
[08:44:23] <remonvv> Doing it directly now.
[08:44:33] <remonvv> One somewhat worrying point is that it's about 3 times as fast.
[08:45:40] <remonvv> fjay, directly it does work
[08:46:21] <fjay> my only guess
[08:46:32] <remonvv> mongos maybe doesn't support that read preference.
[08:46:35] <remonvv> questionable though
[08:46:56] <fjay> how many mongos do you have?
[08:46:59] <fjay> just 1?
[08:48:52] <fjay> well i would love to help more but.. its heading on 2 .. and i slep for like 4 hours last night
[08:49:11] <fjay> good luck
[08:49:20] <remonvv> cheers ;)
[09:25:40] <double_p> Tue May 28 11:22:31 out of memory shell/collection.js:128
[09:25:45] <double_p> gnnnnnn!
[09:34:14] <Hui_Nan> hi all
[09:40:28] <Hui_Nan> How to remove a subdocument? (http://pastie.org/7973269)
[09:41:28] <Nodex> with $pull
[09:41:52] <Hui_Nan> Nodex: see paste, does not work %-(
[09:41:53] <Nodex> db.foo.update({CRITERIA},{$pull:{foo:{bar:1}}});
[09:43:05] <Nodex> or in your case ... db.foo.update({},{$pull:{tasks:{type:"affiliate"}}});
[09:43:43] <Hui_Nan> I need to remove only one subdoc, that with type:'affiliate' and with data:"3"
[09:44:36] <Nodex> then you need the positional opertor
[09:44:39] <Nodex> operator*
[09:52:45] <Hui_Nan> how?
[09:53:58] <Hui_Nan> i can't use $ as an argument to $pull: "Cannot apply $pull/$pullAll modifier to non-array"
[09:54:53] <Nodex> read the docs - it's all there :)
[10:06:38] <Hui_Nan> it's over my modest mind
[10:06:42] <Hui_Nan> anyway, thanks
[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:28:34] <angelazou> apt-get install mongodb
[12:28:44] <angelazou> executed as root of course
[12:30:23] <Number6> angelazou: We recommend using the following repo - http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
[12:30:32] <Number6> It's far more up to date than the ubuntu one.
[12:31:01] <Number6> So you'll need to do an $apt-get purge mongodb , before installing the one from the 10gen repo
[12:33:46] <angelazou> yeah, except that it only remove 20some KB of content...
[12:34:07] <angelazou> shouldn't it remove everything...?
[12:36:06] <angelazou> number6: the installation failed, I got dpkg: error processing /var/cache/apt/archives/mongodb-10gen_2.4.3_amd64.deb (--unpack):
[12:36:12] <angelazou> trying to overwrite '/usr/bin/mongo', which is also in package mongodb-clients 1:2.0.4-1ubuntu2.1
[12:36:20] <angelazou> which does sound like the problem with purge
[12:36:34] <Number6> Apt-get purge should remove the binaries and the configuration files. use apt-get clean to remove /var/lib/mongodb
[12:36:40] <angelazou> I used this sudo apt-get --purge remove mongodb
[12:36:46] <angelazou> I do believe it's correct
[12:37:01] <angelazou> when I removed it, it says After this operation, 41.0 kB disk space will be freed.
[12:37:09] <angelazou> (Reading database ... 62546 files and directories currently installed.)
[12:37:21] <angelazou> purge doesn't seem like enough...
[12:37:25] <Number6> Ok, just try using "$apt-get purge mongodb" instead of using --purge
[12:38:19] <angelazou> number6: still After this operation, 41.0 kB disk space will be freed.
[12:38:58] <angelazou> ha...autoremove
[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:27] <angelazou> really?
[12:41:41] <angelazou> shoot, still failed
[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?
[12:48:49] <angelazou> root 15216 0.0 0.0 8104 924 pts/0 S+ 20:48 0:00 \_ grep --color=auto mongo
[12:49:23] <Number6> Ok, so it looks like MongoDB isn't running. Try a $service mongodb restart
[12:50:43] <angelazou> number6: restarted it, and I still got
[12:50:43] <angelazou> root 15267 0.0 0.0 8104 924 pts/0 S+ 20:50 0:00 \_ grep --color=auto mongo
[12:51:59] <Nodex> netstat -pan | grep mongo
[12:52:08] <angelazou> nada
[12:53:06] <Nodex> netstat -pan | grep 27017
[12:53:24] <angelazou> nada
[12:53:30] <Nodex> then it's not running
[12:53:43] <Nodex> unless of course you changed the default port
[12:54:00] <angelazou> nope I didn't change that
[12:54:47] <angelazou> I'm looking at the logs
[12:55:04] <angelazou> https://gist.github.com/angelazou/5662574
[12:55:28] <Nodex> ls -alsh /var/lib/mongodb
[12:55:55] <angelazou> wow there is a 64M local.0
[12:55:59] <angelazou> 16M local.ns
[12:56:09] <angelazou> and mongod.local and journal
[12:56:18] <Nodex> does it exist and does the mongodb user have permissions to run there?
[12:56:25] <Nodex> run/read/write
[12:56:43] <angelazou> yes, except the journal everything else is root:root
[12:56:53] <ncls> hello Nodex, are you from Toulouse ?
[12:56:58] <angelazou> can I delete local.0 and local.ns?
[12:57:03] <angelazou> they're way too big
[12:59:54] <Nodex> angelazou : what exactly is the problem?
[13:00:05] <angelazou> I can't get mongodb start
[13:01:13] <angelazou> crap
[13:01:19] <angelazou> I tried to open the local.0 file
[13:01:27] <Nodex> dont touch the files
[13:01:38] <angelazou> now it's frozen
[13:02:03] <Number6> The system has frozen?
[13:02:14] <angelazou> I couldn't quite
[13:02:17] <angelazou> quit
[13:02:54] <angelazou> this is what I got https://gist.github.com/angelazou/5662612
[13:03:49] <Nodex> why are you messing with the files?
[13:03:59] <angelazou> I wanted to delete them, it was 64M
[13:04:26] <angelazou> okay, I'm back
[13:04:31] <angelazou> what should I do next?
[13:05:11] <Nodex> dont delete files
[13:05:22] <angelazou> I didn't delete it....yet
[13:05:31] <Number6> ls -l /var/lib/mongodb -- the perms should be mongodb mongodb
[13:06:16] <angelazou> changed it, but I'm still getting the errors
[13:06:31] <Nodex> locate mongodb.lock
[13:06:40] <angelazou> yes?
[13:07:11] <angelazou> should I delete it or what?
[13:07:16] <Nodex> yes
[13:07:23] <Nodex> then killall mongodb
[13:07:57] <angelazou> got it
[13:08:04] <angelazou> finally...!!!
[13:08:07] <angelazou> thank you all
[13:08:09] <Number6> :-)
[13:08:24] <Number6> http://www.youtube.com/watch?v=NcGzwyTvkIQ&feature=endscreen&NR=1 -- You got it!
[13:44:06] <redfox_> hi, someone ever tried to compile nginx-gridfs for windows?
[13:48:25] <pabbie> Hey everyone, Im new here. Whats the easiest way to install mongoDB on a linux server through SSH?
[13:48:47] <Gargoyle> pabbie, what flavour?
[13:49:58] <pabbie> ubuntu
[13:50:21] <algernon> apt-get install mongodb-server then
[13:50:33] <pabbie> ty =)
[13:50:55] <Gargoyle> pabbie: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
[13:50:59] <algernon> or follow this guide: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/ to get the latest & greatest
[13:51:32] <pabbie> so mongodb-10gen it is then?
[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
[13:52:37] <pabbie> newbish*
[13:53:46] <Number6> pabbie: Everyone starts off as a newbie at some point in time
[14:06:36] <pabbie> number6 ty :D
[14:07:55] <pabbie> quick question though, in that installation guide, I notice theres a curve command. What does that do? never seen it before
[14:08:34] <Gargoyle> curve command?
[14:08:35] <Number6> curve command?
[14:08:57] <Gargoyle> Jinx!! :p
[14:09:14] <pabbie> haha yeah
[14:09:15] <Number6> Pinch for you, surprise for me!
[14:09:22] <pabbie> curl http://downloads.mongodb.org/linux/mongodb-linux-x86_64-2.4.3.tgz > mongodb.tgz
[14:09:29] <Number6> (I hope the surprise is Toblerone)
[14:09:56] <Number6> pabbie: Are you not using http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/ as the install guide?
[14:10:01] <pabbie> I had Toblerone yesterday =)
[14:10:19] <Gargoyle> pabbie: Threre is no "curl" command on the proper ubuntu install instructions page.
[14:10:29] <pabbie> oh snap, I was here, my fault: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-linux/
[14:10:32] <pabbie> haha
[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:16:49] <pabbie> haha, bitcoins?!
[14:17:51] <starfly> pabbie: no comp for real, just like to help when/if we have time
[14:18:21] <pabbie> woaahh ^
[14:18:51] <pabbie> much appreciated starfly =)
[14:20:40] <starfly> pabbie: NP, as someone mentioned, we've all been there--good luck
[14:21:03] <pabbie> I connected to the mongo instance using: Mongo. And got this message
[14:21:04] <pabbie> http://pastebin.com/2xNG1yqF
[14:29:41] <starfly> pabbie: we're on RHEL, not Ubuntu, but we run with zone_reclaim_mode value of 0
[14:33:42] <pabbie> ahh I see
[14:34:09] <pabbie> Im following this guide to setup a basic example for this project I'm in
[14:34:10] <pabbie> http://coenraets.org/blog/2012/10/creating-a-rest-api-using-node-js-express-and-mongodb/
[14:42:00] <Number6> pabbie: Do you know what hypervisor your VPS / VM provider uses on your server?
[14:42:24] <pabbie> I have no idea what a hypervisor is
[14:43:09] <Number6> It's the layer between your VM and the physical host - like the chicken in a sandwich
[14:43:45] <pabbie> hehe ok
[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
[14:48:33] <pabbie> http://knowlisher.com:3000/wines/1
[14:51:25] <Number6> pabbie: Is the VM brand new?
[14:52:01] <pabbie> I have no idea tbh, I was given the crendtials recently I kinda thrown into the project without being given so many specifics
[14:53:27] <Number6> pabbie: Trial by fire :-)
[14:53:44] <pabbie> heap, thrown into the tigers cage
[14:53:50] <pabbie> yeap*
[14:54:24] <Number6> Trust me, you want a Xen VM. GleSYS (your host) have Xen machines that only seem to be about €3 more expensive than OpenVZ.
[14:55:44] <pabbie> so, this is good then? haha..I have no idea what we're talking about
[14:56:06] <pabbie> my server knowledges stretched as far as me hosting a minecraft server on ubuntu from home
[14:56:08] <pabbie> end of.
[14:56:10] <pabbie> :P
[14:56:12] <Number6> :-D
[15:02:47] <pabbie> does this look alright to you? http://knowlisher.com:3000/wines/
[15:05:49] <pabbie> question now is, if this is looking alright. How do I populate the wines list from outside..from..for example a simple html page
[15:13:10] <Nodex> eh?
[15:17:51] <pabbie> number6 where are you? I need you =)
[15:22:10] <Nodex> what's the problem?
[15:30:46] <pabbie> nodes hi! well I've followed this guide http://coenraets.org/blog/2012/10/creating-a-rest-api-using-node-js-express-and-mongodb/
[15:31:11] <pabbie> and now I want to post data to the mongoDB from a simple html page
[15:31:23] <pabbie> but I don't know how to…
[15:34:21] <hjrnunes> hi guys
[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:24:28] <pabbie> gargoyle ! you
[16:24:35] <pabbie> you're back =) I need your help
[16:24:40] <Gargoyle_> :)
[16:24:48] <Gargoyle_> I never left! :P
[16:24:50] <pabbie> I'm happy to see you =)
[16:24:53] <pabbie> hehe
[16:25:05] <Gargoyle_> Too many computers in this house! ;)
[16:25:11] <pabbie> haha
[16:25:26] <pabbie> I'm stuck at work, everyone has left but I don't wanna lave before I figure this out
[16:25:50] <pabbie> You know that guide I was following? with that wine example?
[16:26:02] <Gargoyle_> Nope. I missed that link.
[16:26:09] <pabbie> ok one sec
[16:26:16] <pabbie> http://coenraets.org/blog/2012/10/creating-a-rest-api-using-node-js-express-and-mongodb/
[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:36:21] <Gargoyle_> pabbie: I have no idea!
[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] <pabbie> yeah
[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
[16:51:42] <pabbie> python!
[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:03:59] <aidanie> Gargoyle_: Thanks!
[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:08:35] <OliverJAsh> on*
[19:23:58] <merpnderp> Mongo will eventually rule the world: http://blog.mongodb.org/post/51574091391/mongodbs-new-matcher
[19:24:07] <pabbie> Hello again! Heres come pabbie with nebbish question! :D
[19:24:16] <pabbie> newbish* damn autocorrect
[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:09:11] <pabbie> and I can't figure out why
[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:15:56] <pabbie> ok , ty.. ill get to it
[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:53:41] <crudson> querying^
[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:38:07] <skram> awesome thanks.
[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
[22:52:12] <skram> crudson: checking it out now
[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 :)