[00:12:28] <mack_> Hi! Can a Mongo node (machine) be a member of multiple replica sets? Like can it be a secondary on one set and a primary on another set?
[00:15:39] <mack_> What was the decision behind this?
[00:16:08] <cheeser> well, i wasn't there but probably there are complexity concerns at work here.
[00:18:40] <mack_> Hmm, because I'm thinking, if one were to deploy two Mongo machines for geographically distributed replication (east coast / west coast) then they might as well also be used to reduce latency for homed in users who are closer to them. Since Mongo doesn't have multiple masters, I was thinking of creating two shards (replica sets) and have each machine host one of the sets as a master and host another as the slave.
[00:19:16] <cheeser> you can do sharding like that, yes. each shard would/should the be primary of a replica set.
[00:24:21] <mack_> So then, one machine would host one shard of the data but not be a master of its replica set, then the other machine would host the replica set (one instance/backup) of the other machine's shard?
[00:24:47] <mack_> So then, one machine would host one shard of the data but not be a master of its replica set, then the other machine would host the replica set (one instance/backup) of the first machine's shard?
[00:25:12] <cheeser> no. each shard is/can be the primary of its own replica set.
[00:28:42] <mack_> Thanks for the links cheeser, if you have two machines, how can you then create two shards (primaries of replica sets) on each of the machines and have the other machine be a secondary ("backup" as you put it) on the other's shard?
[03:22:40] <haggen> hey fellas, I need a little help with an aggregation
[03:24:48] <haggen> i have a history of buying and selling orders -- fields are item, price and a boolean that's true for buying and false for selling, i'd like to output 2 average prices per item: buying-average and selling-average
[03:31:23] <Nilium> And I'm currently drinking and am kind of bad with mongodb since my entire experience with it has been trying to eek what little performance I can out of someone else's garbage code.
[03:33:24] <haggen> it's ok, enjoy your drinking night
[03:33:53] <Nilium> I probably won't be wasted tonight unless I somehow manage to down this entire wine bottle, so I'm probably fine
[03:34:19] <haggen> order a pizza, pizza goes well with wine
[03:34:39] <Nilium> Anyway, you probably want to look into what you could do with either mapReduce or aggregate (not sure about the actual usage of either -- I haven't touched them)
[03:34:44] <haggen> not pizzahut or dominos , a more italian kind of pizza
[03:35:29] <Nilium> Could probably just use $avg and filter on the bool though
[03:35:43] <haggen> thanks :) i probably could find a fix with mapReduce but i was trying to stay away of it, you know, when you've got a hammer everying's kinda looking the same
[03:36:28] <haggen> wait wait, the part about "filter with the bool" what's that ?
[03:37:25] <Nilium> Use the buying/selling bool as a selector to only match those documents, then average over them
[03:37:25] <haggen> i was trying with aggregate right, i manage to average all the prices of an item, buying or selling, but I want to split the averages in two fields
[03:37:50] <haggen> but then I would have two results wouldn't I ?
[03:38:01] <Nilium> Sure, but you can just combine them programmatically.
[03:38:02] <haggen> i'd have to merge them or something like this
[03:44:29] <Nilium> Well, you'll know whether or not if you manage to get it working, I'm just throwing out ideas for things I've not actually done
[03:46:29] <Nilium> Also, this raspberry wine was not the best use of $12.
[04:42:50] <barque> So if I want to communicate with a MongoDB instance running on a local server, I need the C++ drivers I presume... and for a production environment you guys would recommend 26compat? Also, I'm not getting this wrong... right? I can read to and write from a local MongoDB instance...
[04:43:18] <barque> also I need to actually communicate from a program written in C++ :)
[04:43:44] <barque> Basically a game server... that has a NodeJS/MongoDB side for the web 'side' of thing
[04:49:26] <barque> the MMO portal is entirely HTML5 Canvas + Javascript... so I'm actually willing to throw my lot in with a full (J/B)SON NoSQL solution + JavaScript backend
[04:50:00] <barque> I've heard that NodeJS and MongoDB together have come quite a long way
[04:50:11] <barque> and looking forward I'm willing to bet they'll even get better
[04:50:20] <barque> and I'm also willing to bet they already scale fairly
[04:51:00] <barque> also players may buy stuff online or in-game... and the game needs to go back to the MongoDB server to write that stuff
[04:51:22] <barque> also the game may look at their new chat messages on their BSONs in case another player has sent a friend request or a chat message
[04:51:33] <barque> so the game server has to go back and forth with the MongoDB instance
[04:52:17] <barque> (in the given example, the game server will relay chat messages/friend requests to their clients for in-game display)
[04:52:33] <barque> all-in-all is 26compat the way to go ?
[04:52:42] <barque> it says it's production stable
[04:54:20] <cheeser> "If you are looking for a production-ready release of the C++ driver you should use the 26compat branch until our RC testing is complete."
[07:37:26] <sahilsk1> Hi guys, I"ve a query related to authentication in mobile app. I"ve one webservice and want one mobileApp to grant access to my api. There are two things to grant here: First mobile app itself , second user login on that app. any expert advise on how to do it, will be great..
[09:50:34] <laurensvanpoucke> Hello, assume that I have an existing document like { name:"test", urls: [ 'http://firsturl.com' ]} and I want to update it later to { name:"test", urls: [ 'http://firsturl.com', 'http://anotherurl.com' ]}, how can I achieve this ? update an existing document value, and if it has already a value, 'merge' it
[11:20:38] <laurensvanpoucke> Can I do an update on an instance of a model ? I know the syntax is Place.update(where statement, {}) but can I do var place = new Place(); place.update ???
[13:13:03] <gisto> I have a quick question on bulk updates
[15:17:31] <mordof> question involving the geospatial indexes.. i'd like to store polygons in a collection (recording x,y locations of a box) - and then query a single coordinate to find which boxes contain that coordinate. it's not using earth lat,lng though. is this supported?
[15:18:16] <mordof> from what i can tell in the mongo documentation, the geospatial indexes all calculate using the assumption that it's on the surface of a sphere - so wouldn't that mess up a flat surface check?
[15:25:15] <mordof> am i just coming in at bad times? or is my question too obscure?... whenever i come in here to try and get help on this topic it seems dead / nobody will respond to me
[16:25:21] <Patteh> i'm pushing data to a single db collection, and I want to set a limit of 10 documents from each different value of a single selector
[16:25:43] <Patteh> i'm slicing the data before insert so a total or 10 of each is ever presented
[16:26:01] <Patteh> but that wont account for what is already in the db
[16:26:11] <Patteh> is it bad practice to wipe the db before each round of inserts?
[16:26:26] <Patteh> is there a max i can set that will effectively 'push' the other docs out?
[19:05:55] <voidDotClass> In Mongo, is where an equivalent to sql's IN(...) feature, i.e Select where id in (1, 2, 3)
[21:46:55] <barque> is there any other way for me to use the Windows C++ drivers other than using SCons?
[21:47:02] <alexi5> I have heard that objects have a less impedance missmatch with document databases in camprison to relational databases. But with ORMs like entity framework that can model complex relationships, why is there a need for document databases ?
[21:47:46] <barque> alexi5... imagine the amount of overhead required for something like Hibernate to serialize deserialize
[21:48:19] <barque> also 'JSON objects' more than 'Objects' (let's not get ahead of ourselves... you can't probably use it well for C++ objects.)
[21:48:59] <barque> (with like 3 levels of inheritence point to random locations on heap and containing 3rd party API handles :)
[21:49:59] <barque> Also BSONs have their limits too... I mean 100 levels of nesting max.... it's pretty big but nevertheless a limit
[21:50:06] <barque> also 16 MB maximum size of each document
[21:50:32] <barque> also replace 'a less' with 'they just freakin' don't'
[21:54:06] <barque> Basically to put it this way... if you're using a crapload of JavaScript on the frontend... you will itch to use JavaScript on the bankend (NodeJS anyone?)... and if you're using it on the backend... then you'll itch to store your JSONs as they are... in which case MongoDB or CouchDB will kick in
[21:55:10] <alexi5> so ii guess using ORM and RDBMS to store objects with complex relationships is like putting a square in a round hole
[21:56:11] <barque> And from what I've see, you really have to be able to boil it down to primitive data types
[21:56:40] <barque> And the same goes for relational DBs too anyway
[21:57:23] <alexi5> i was trying to decide between a RDBMS and mongo fo an application that will catalog various equipment with different attributes , and from your explanaition it looks like i may shoot myself in the foot by using an RDBMS
[21:58:12] <barque> alexi5, I spent over a year at the government doing JEE5+Spring (JSF/RichFaces/MyFaces/Spring/MyBATIS/iBATIS)
[21:58:23] <barque> it was like watching a lot of grown men pour money in a pit and set it on fire
[21:58:41] <barque> WAS7 load balanced with IHS + Oracle 10g for persistence
[22:01:41] <barque> I work in the mobile department
[22:03:15] <barque> The more time I spend in the I.T. industry, the funnier it becomes
[22:03:22] <barque> people are lost ..... everywhere .....
[22:03:47] <barque> they're trying to one-up each other in using the trendiest crap out there.... instead of really stopping for 2 seconds to evaluate what they're doing
[22:03:57] <barque> and they make up the most ridiculous arsnine excuses to go with it
[22:04:03] <barque> not to mention politics rules the day
[22:04:12] <barque> it's a ****ing 3-ring circus no matter where you go
[22:04:24] <cheeser> this really belongs in a blog and not in channel
[22:23:28] <alexi5> i wonder what I.T companies are like in the UK
[23:21:51] <barque> if I have a binary on the same machine as a mongod instance... and I'm communicating with the mongod through mongo command line with redirecting .js files instead of stdin... is that efficient?