[01:06:02] <patrickod> why is there no out: option with aggregation?
[01:06:10] <patrickod> it's almost useless with a 16mb limit
[01:38:37] <Max-P> Hi, I need to query for the last element of an array in a document, how can I do that? I need to find the immediate childs in a tree (all parents are in an ordered array)
[02:37:55] <niriven> i so badly want it to work :(
[02:40:34] <niriven> so a long story short, i get an assignment to import 151 million events, and 1075 users into mongodb. the event may or may not 'relate' to a user (4% of the events acutally relate.) so i start by inserting all events related to a user in in event_a, and all events not related to a user in event_u, and all user into user. great, works fine, until have to do some really complicated queries (eg. find users that have events of type a b
[02:41:44] <niriven> so i have to join in code, fair enough, but then things no longer become optimized even though things are indexed. I have to query id's up front that match critera a, and ids tha tmatch criteria b, then query mongo and do some logic in code. so i figure, why not reprepsent everything as a user object? {user {events}}, great, until indexing crashes!
[02:43:21] <niriven> creating indexes crashed mongo, sometimes it did, sometimes it didnt, thought i ran out of memory, grabbed an ec2 instance with 16 gigs of memory instead of 8 gigs, and high io, another crash.
[08:38:18] <Signum> I start to like the new aggregation feature in 2.1/2.2. But has anyone understood how to group on nested data? i.e. http://pastebin.com/9DsetKSf
[10:29:36] <newbie_> meghan: seems i tried it long time ago, had minor issues with the non-free part, and some other thing i cant remember. but thanks.
[10:30:09] <newbie_> need to make my mongo secure. it isnt secure by default and i can connect over it remotely easily without any security user/password asked
[10:49:32] <Cubud> NodeX : I think I have thought of a way to ensure my video ratings are up to date and accurate
[10:50:14] <Cubud> I have 2 members on "Video" called "StatisticsCalculatedUntil" and "LastStaticalChangeOn"
[10:50:32] <Cubud> When I add a rating I update video.LastStatisticalChangeOn and then insert the rating
[10:51:13] <Cubud> That way if the rating doesn't get saved a process will later run to select ratings between StatisticsCalculatedUntil and LastStatisticalChangeOn and simply find nothing to update
[10:52:14] <Cubud> If it does find data then I can do an atomic update on the Video updating both the statistics + StatisticsCalculatedUntil
[14:05:11] <solars> hey, I (or my boss) came across http://blog.engineering.kiip.me/post/20988881092/a-year-with-mongodb - is there any discussion going on about this? I've recently read this anonymous blah article putting mongodb into bad light so I'm a bit curious
[14:12:20] <NodeX> the only thing that puts mongo in a mad light recently is idiotic users who dont know what they're doing
[14:14:13] <NodeX> the majority of "The bad" in that post have been addressed or are being addressed. Mongo cannot be held responsible for a developers poor choice of schema design and bad coding practices
[14:15:01] <rcmachado> I think the biggest error is using MongoDB as if it was a traditional database (like MySQL or Postgres).
[14:15:25] <NodeX> that is the number one epic fail for users of mongo
[14:24:13] <fitzagard> solars: I believe the root of any proper architecture discussion is "does this thing fit our needs". If the answer is "maybe" then you experiment, test, verify, rinse and repeat the process.
[14:24:52] <NodeX> solars : Mongo never claims(ed) to write data deterministicly, it never claimed to do half of the stuff in that post lol
[14:25:10] <http402> solars: it depends on what you intend to use your data for
[14:25:23] <http402> all of the "negative" points in that kiip article are actually legit
[14:25:24] <NodeX> what it does -correctly- do (in my opinion) is take all of that important stuff and leave it in the hands of the developer
[14:25:31] <http402> as of at least 2.2 which im running a cluster of right now
[14:26:04] <NodeX> which results in speed and performance
[14:26:15] <http402> well except "global" lock is now down to "database" level lock i believe (not database, not collection) and i believe it's still a global write lock, just no longer global read locks which screw with replication
[14:26:29] <http402> *NOTE database, not collection
[14:26:36] <solars> NodeX, which post are you referring to
[14:26:45] <solars> thats why I'm asking if there are comments to it :)
[14:26:47] <NodeX> solars : the second one you posted
[14:27:47] <http402> NodeX: ive met a lot of developers that actually got mad because they Mongo doesn't do a good job of describing which queries don't work well dynamically
[14:28:01] <solars> that is why I posted the first link as I'm not sure about these 'facts' and wanted to ask if there is already a discussion or comments
[14:28:51] <http402> of course, you should test it out in your use case all of the way
[14:29:09] <NodeX> I've been using Mongo for a very long time in production, I have never had a problem (apart from early geo spatial queries) that I could not get around
[14:29:14] <http402> also, make sure that you keep your data set in ram as much as possible, it doesn't swap well, but thats not mongo-specific
[14:29:37] <NodeX> I have no performance quarms and i never have
[14:29:39] <http402> riak doesnt either and redis wont even let you exceed ram
[14:47:51] <topriddy1> NodeX: my app db isnt exactly critical, so i'm experimenting with it for now. i just have few entities which don have major risk.
[14:47:51] <NodeX> ACID is somehting from the 60's !!
[14:51:29] <topriddy1> NodeX: well i am using one node. i am working on a chat app, where i need to store some info on the user in a db (mongo), also i post locations periodically. thats about it. can survive without a traditional db.
[14:51:37] <NodeX> [15:47:37] <topriddy1> NodeX: quick one, if i do db.users.save({name: "Paul"}); maybe i could still do: db.users.save({name: 32}); <--- I dont see the problem
[14:54:32] <NodeX> I think you're talking about your driver when you refer to "datatype"
[14:55:03] <topriddy1> NodeX: unfortunately so. Mongo doesnt have this info in itself about "datatypes"
[14:55:36] <NodeX> so what's throwing the Exception ?
[14:55:42] <topriddy1> NodeX: i'm also scared of what might happen if i mistakenly do a db.users.remove();// not sure yet if i have a rollback mechanism. i dont know if i can even do transactions, etc.
[14:56:01] <topriddy1> NodeX: I said it should throw the exception. (ideally)
[14:56:20] <NodeX> topriddy1 : mongo has NO schema ergo it shouldn't throw anything
[14:56:33] <http402> topriddy1: one safety mechanism other people have used is delayed replica set - keep one replica 15 minutes behind the others and you have a window of recovery
[14:56:39] <topriddy1> NodeX: i'm newbie to mongodb, still learning a lot though,
[14:57:05] <topriddy1> those are bleh for some kind of apps
[14:57:26] <NodeX> hence it doesnt fit all kinds of apps
[14:57:44] <topriddy1> NodeX: thanks for engaging me sir/ma. hopeful it fits my chat app.
[14:58:07] <NodeX> http://www.boneheadbeats.co.uk/radio <---- 60 minutes form start to finish on that chat room
[14:58:18] <NodeX> Mongo based, redis backed, Node.js for the transport
[14:58:53] <NodeX> infact not sure if it's even running lol
[14:58:59] <topriddy1> NodeX: i'm using xmpp. mobile based. just put certain info on mongo. java+morphia at the moment. things working fine.
[15:00:05] <topriddy1> NodeX: you wrote that i guess?
[15:01:50] <NodeX> yer, quick POC for a freinds radio station
[15:08:22] <mdeboard> Hi, when I added a member to a replset, that new member was suddenly primary. Now my former primary is in "rollback" status. My intent was to add this new member and start replicating the data but now ... am I losing all my data or what?
[15:09:27] <mdeboard> "We are ahead of the primary, trying to roll back."
[16:49:07] <timeturne> that's actually what I'm trying to figure out. basically the scenario is that user A creates a team. Users C, D, E, and F join that team. User A is not the team captain in real life, he/she just happened to be the first one to create the team. Some time later, User G shows up and requests User A to become the team captain because User G is the real team captain. If User A accepts then User A becomes just a team member or a
[16:49:08] <timeturne> co-captain. but I'mtrying to think about what should happen if User A doesn't respond to User G's request. thatwould basically mean that some other team member has to take User A's place and accept or decline User G's request.
[16:51:38] <NodeX> I do something similar in one of my apps - checking that a user has "Activated" - I use workers to occasaionaly check my user collection(s) for it
[16:52:20] <_m> We save a "last_active_at" timestamp periodically.
[16:53:02] <NodeX> ^^ I also (for different reasons) update tiemstamp every time someone does somethign to the record
[16:54:02] <_m> ^This. I think a fair standard are: created_at, updated_at, last_active_at, last_login_at
[16:54:39] <_m> At least, most applications I've authored have tracked at least those.
[16:54:43] <timeturne> and then use a formula which averages those values ^?
[17:32:22] <Turicas> I can't load CSS of api.mongodb.org/wiki/current/... (I've tried with and without proxy). Is there any place where I can fill a bug?
[17:36:43] <timeturne> Turicas: I don't think there is any css on that page.
[17:38:55] <Turicas> timeturne, But I think this page should have more CSS
[17:39:14] <Turicas> timeturne, this page calls styles/site.css (it exists)
[17:39:31] <Turicas> timeturne, but site.css have some error messages in there, like "/* Could not locate resource: /includes/css/master.css */"
[17:39:54] <timeturne> yeah then whoever did the docs screwed up he markup
[18:56:04] <mids> https://github.com/ajdavis/chirp is implemented with a bunch of different mongodb drivers
[18:56:22] <mids> maybe you can use some web based load balancer on it
[18:56:27] <rcmachado> mids: but here where I work some guy is working on an implementation, more like asyncmongo
[18:56:54] <rcmachado> mids: and I want to test it too, to see if is really worth
[18:58:50] <rcmachado> mids: I will look at that! thanks!
[19:22:01] <aster1sk_> Hey mongodb friends. I'm playing with the new aggregate framework and struggling to work with arbitrary keys. I have a heavily nested document and need some direction.
[19:27:56] <aster1sk_> Say I had a.b.c.123.c (the 123 is a mysql id) - I'd like to aggregate group / aggregate on 'c'.
[19:28:40] <aster1sk_> I think unwind is what I need but I've just about run out of patience.
[19:38:31] <dstorrs> morning all. In a sharded cluster, I'm connected to a config server and I want to ask "are the config servers currently read-only?" what is the correct command?
[19:38:45] <crudson> aster1sk_: I assume the second 'c'; there are two. Can you create a paste of your document(s) and what you are executing?
[19:43:26] <whitaker> Howdy. Rails/Mongoid question here. I've recently upgraded my mongodb instance to v2.2.0, and my mongoid gem (under Rails v3.2.8) to v3.1.0. I have a model which includes Mongoid::Document, and defines a field as type Array. Before, attempts to assign this field with scalar values would properly throw a Mongoid::Errors::InvalidType error, but that behavior seems to have gone away. Now, type checking seems to have been disabled o
[19:43:27] <whitaker> fields declared as Array, such that anything can be assigned to the field. I've searched in vain for workarounds to restore type check validation; anyone else dealt with this behavior?
[19:49:19] <whitaker> <- thinking posting a query during San Francisco lunchtime not the best idea
[20:08:48] <kchodorow> dstorrs: like, "is one of you down and therefore the rest of you are readonly?"
[20:09:25] <dstorrs> or should I just look in a mongos log and see if the distrib lock pinger is responding?
[20:13:41] <kchodorow> i think the lock pinger is the best you're going to do, they don't "really" become read-only, mongos just stops trying to write to them
[20:17:10] <elliot-w> hi mongoids. We're maxing out file descriptors in our nodejs/mongodb(replicaset+gridfs) QA environment. My questions -- will these open descriptors be recycled when the offending process is restarted? Other than boosting the open descriptor limit in the OS to fix the issue... is there any way to catch this before it happens? I'm concerned that this will come up again in production.
[20:18:14] <whitaker> (Shorter version of question I asked before): has type check validation of Array field type in Mongoid::Document gem been recently disabled?
[20:18:35] <cyberd0m> Hi, I've asked in #node.js but maybe it's more pertinent to ask here. Basically, I can connect to mongo with the 'mongo' shell.. but not from node. I really have no idea what to try.. this should work.
[20:31:13] <cyberd0m> I was trying to use it from mongoose.. i.e. require('mongoose').connect('mongodb://localhost/test').. but couldn't get it to work, so I've tried with 'mongodb' with no more success.
[20:39:08] <aster1sk> Lets pretend I have this : a.b.c.123.v
[20:39:10] <aster1sk> I want to $group : { 'views' : { '$sum' : 'a.b.c.<unknown>.v'\} }
[21:43:56] <SeyelentEco> Hi all, anyone know of an easy way to test if queries are being sent to replication servers? I'm running PHP, I have 4 replica sets (1 offsite), setup a seperate environment on offsite box, but application is slow... seems as though it's querying primary.
[21:44:14] <SeyelentEco> I've set slaveokay for db connection
[21:56:17] <timeturner> is it worth it to shorten field names as much as possible in documents? possibly to single letters?
[22:02:18] <SeyelentEco> I've heard of people doing it (one presenter at MongoDB Seattle said his company did it)
[22:02:25] <SeyelentEco> saves on space for really large collections
[22:02:30] <wereHamster> timeturner: if the size of the keys contributes significantly to the overall data size, then you might consider it
[22:02:57] <wereHamster> otherwise stick to long names as it makes development easier.
[22:03:04] <timeturner> I wish mongo compressed the key values
[22:06:12] <timeturner> maybe I'll just use virtuals
[22:06:27] <timeturner> put them in my initMongoose js file or something
[22:06:30] <dbe> Hey everyone. I have records with a date field. I want to group based on "week buckets" which would be one group for every 7 days going backwards from today. Any idea on how to do this with the aggregation framework?
[22:06:46] <timeturner> actually I'll put them in my schema files individually
[22:19:43] <timeturner> wereHamster: any opinions on this https://github.com/tblobaum/mongoose-troop
[22:23:13] <niriven> hi, is there a opposite of $ne in mongo? or do i just use $nin[1]