[03:18:44] <dman777_alter> in a people collection I have "guests" in each document....some documents with "guests: "0"" some with "guests: "2"", and so on. How do I aggregate all the documents and get the total amount of guests?
[03:26:10] <joannac> dman777_alter: $group and $sum
[03:26:59] <dman777_alter> db.guests.aggregate([ { $group: { total: { $sum: "$guests" } } } ])? sorry, collection is also called guests
[03:29:11] <dman777_alter> I did this but got 0 for guests key field values
[09:42:15] <kurushiyama> mick27: Clients opening new connections for the connection pool, incoming data with the need of processing and compression, cache heating... Stuff like that
[13:46:27] <fiatjaf> http://pastie.org/pastes/10843915/text my mongodb.conf
[13:46:57] <fiatjaf> (it is mongodb.conf, not mongod.conf, the path is correct, just double-checked)
[13:47:44] <dragonmantank> I'm trying to connect to a remote MongoDB server using the Mongo PHP extension (not the new one), but keep getting "SASL Authentication failed on database 'admin': Authentication failed". I've tried specifying a database both in the connection string, and as an option, but it seems to keep trying to connect to 'admin'. Any ideas?
[13:48:21] <Derick> sasl is afaik always against admin
[13:48:30] <Derick> can you show the connection string?
[13:49:24] <cheeser> fiatjaf: "fails with the wiredtiger thing" ?
[13:49:34] <cheeser> the server comes up successfully?
[13:49:58] <dragonmantank> Derick: mongodb://iad1-mongos1.domain.com:16229 is the server name being used, passing an array of [w=>1, db=> mydb, password=>mypass, username=>myuser, connect=>false]
[14:01:52] <Derick> dragonmantank: for SASL auth, you need to do a bit more
[14:02:05] <dragonmantank> Derick: And changing the server string to mongodb://myuser:mypass@iad1-mongos1.domain.com:16229 or mongodb://myuser:mypass@iad1-mongos1.domain.com:16229/mydb returns the same error
[14:09:03] <fiatjaf> it should be, but I have removed it
[14:09:22] <fiatjaf> just to be sure, tried now with dbpath=~/db. it has failed again.
[14:09:28] <Industrial> Is there a query for removing all duplicate documents? e.g. the ones with the keys and values that are identical except the _id ?
[14:09:34] <dragonmantank> Derick: I'll look into that then. Looks like we just used pickle to install it with defaults
[15:56:59] <mehwork> i've heard that mongo can lose data and isn't good to use if data integrity is paramount, but is that really true and if it is how so?
[15:57:38] <yopp> mehwork, everything can lose a data.
[15:57:54] <starfly> mehwork: If data integrity is paramount, you might want to look for ACID support
[15:58:46] <starfly> P.S. in a relational database
[15:59:35] <Derick> mehwork: I am not sure where you heard that, but that's sortof true for every information system
[16:00:05] <mehwork> Derick: random internet articles, but i don't automatically trust bloggers either. But they seem to go after mongo particularly in this area
[16:00:17] <Derick> mehwork: it should certainly not mean you can't use MongoDB for anything mission critical
[16:00:44] <mehwork> i think the arguments were mainly about schemalessness being less durable
[16:00:53] <dragonmantank> Derick: Not sure. I'm putting in a support ticket with the SaaS.
[16:01:12] <Derick> mehwork: "less durable" - I don't know what that has to do with schemalessness
[16:01:14] <mehwork> but i take it that's similar to saying dynamically typed languages can't be used for mission critical apps, which isn't true either. It's just maybe requires a little more effort
[16:01:21] <dragonmantank> I should have all my ducks in a row, so hopefully it's just them or me not understanding something they are doing
[18:02:48] <dragonmantank> Derick: so the hosted mongo SaaS we are trying had to add my user to the `admin` database, and everything worked after that. Thanks for the help wth the SASL stuff though
[20:13:55] <Doyle> I put this little guy in the mongod init, and it works, I think it's getting reset after the service starts on boot. RA="$(blockdev --report | grep xvdb | awk '{print $2}')" ; if [ $RA -eq 32 ] ; then : ; else blockdev --setra 32 /dev/xvdb ; fi
[20:29:54] <RxDx> hi.. I develop APIs using Rails, but Im reading about NodeJS and its frameworks like MEAN.. I am thinking if mongo is a good choice for building common crud (with some business logic) APIs, because most of the data are relational data (like Product has an User).. if I become using this relationships I will lost the power of mongo, right?
[20:30:13] <kurushiyama> Uh, 7. Hmm. Have to look, but I guess sysctl.conf or sth should be there.
[20:31:12] <kurushiyama> RxDx: You model relations differently, and optimize for use cases. But if relations were a serious problem, nobody would use MongoDB.
[20:31:42] <kurushiyama> RxDx: The power of MongoDb is that you actually _can_ highly optimize relations.
[20:32:46] <RxDx> hmm... my API data are basically relational.. but some cases like Product has many Comments.. is bad using SQL
[20:39:59] <dfinn> kurushiyama: one more question which may show off my python ignorance. the data that is returned from that command looks like a dict yet I get errors when I try to use it like a dict. do I need to do something to get that data in a usable format?
[20:53:16] <mehwork> RxDx: in my current opinion, mongo is mainly used by people who don't know sql but already know js. I'm sure there are some intelligent people who have other reasons for using it, but that's what i've noticed so far
[20:53:49] <mehwork> because it takes a lot away from you in terms of what relational db's give you, but gives you other things
[20:54:33] <RxDx> mehwork, I think postgresql is good for me, but can I implement a chat or comments using it? the table will be extremely big!
[20:55:30] <mehwork> depends what engine you use, 'postgres' and 'mysql' are vague terms that don't specify what engines you're using with them
[20:56:57] <mehwork> most of them support json stores and other things that are more 'nosql'
[20:57:12] <mehwork> but then it's more an argument of nosql vs sql still
[20:58:12] <RxDx> hmm.. ok.. ill read more about it.. thanks :)
[20:58:22] <mehwork> if you don't need sql then it probably doesn't matter
[21:01:49] <mehwork> but we also live in a data driven world where analytics is just as important as web app convenience. I'm too afraid to give up sql but still explore nosql stuff to learn about it so i'm not an expert on it
[21:17:42] <JoWie> RxDx: mongo would probably cost you more time to build your application with for such a use case (assuming you know both postgres and mongo well). So I think it would be more of a question of is this premature optimization, and is that needed (prematurely)?
[23:23:07] <kurushiyama> mehwork: I dare to object. I know RDBMS up and down. I could argue that people still using RDBMS need rules to get their data modelling halfway done, instead of being able to use their own judgement. However, that arguing is abdsurd, either way. The usage scenarios for RDBMS and MongoDB might overlap, but that does in no way mean they are identical, much less interchangeable.