[01:37:24] <Ephexeve> Hey guys, is there a way to put a password to a database? So when I would like to query anything from that db, I need a password first? Otherwise there is NO way I can access it?
[03:19:22] <Reptar> How do I create a collection that is comprised of aggregate groupings from other collections?
[03:40:17] <Mark_> so i just rewrote it with $in/$nin but
[03:55:56] <laprice> OK. I need to get timing details for a set of queries on mongodb.
[03:56:41] <laprice> I've tried the db.collname.find({ foo: "bar" }).explain().millis trick.
[03:57:20] <laprice> but a. that seems really lame. b. http://docs.mongodb.org/manual/reference/method/cursor.explain/#explain.millis
[03:57:45] <laprice> that number is not actual milliseconds, I don't know what it is.
[03:58:37] <laprice> So I'm bashing away at system.profile.find() and I want to always get the most recent query. But I am not getting any joy.
[03:59:56] <laprice> system.profile.find() doesn't let you do system.profile.find({ ns : "collname" }) and only get info on queries against your collection?
[04:05:44] <laprice> actually it looks like system.profile.fine({ ns : "dbname.collname" }) works.
[04:05:58] <laprice> But how do I get only the most recent one?
[04:07:09] <laprice> system.profile.fine({ ns : "dbname.collname" }).limit(1) goes in the wrong order
[04:15:32] <laprice> http://docs.mongodb.org/manual/reference/method/cursor.explain/#explain.millis is that just a doc bug? b/c "reflects" does not tell me if that number is milliseconds, or if it's some metric vaguely related to, or derived from the number of milliseconds required to find the document.
[09:49:26] <chronic52> Best source for advanced mongo
[09:50:47] <tinco> hey guys, I'm performing an update, and in this update I want to upsert an element but in the documentation there is only a push, and the push doesn't seem to have an upsert modifier
[09:55:26] <tinco> so I have this collection: {"notifications" : [{"id" : 1, "occurrences" : [{"id" : 1, "created_at" : 353251}], "uniqueProperty" => "superUnique"}]}
[09:58:22] <tinco> and then I do notifications.update({"uniqueProperty" : "superUnique"}, {'$push' : {'occurrences' : {"created_at" : 353251 }}, {"upsert" => true})
[09:59:14] <tinco> but this will push a new occurrence every time it gets updated, I only want to push a new occurrence if the created_at does not match an existing occurrence
[10:04:38] <tinco> so I create a new notification, or update an existing one based on "uniqueProperty", and when I update an existing one, I want to add to its occurrences array, but only if there's no occurrence at that date yet for that notification
[10:05:26] <kali> so you want to add something to an array if it's not already there, right ?
[10:05:59] <tinco> yes, but the addToSet thing does not allow you to specify an equality property
[10:12:11] <tinco> so this query is in a pretty time critical location, it might be called hundreds of times per second, so I'd like to avoid making it two queries
[10:12:26] <tinco> perhaps I could make it some sort of prepared statement? mongo has that right?
[10:14:16] <tinco> my concern is that there might be hundreds of occurrences per second, and if I just push them all into that occurrences array, it could become very big and slow to query, or perhaps even go over the mongo element size limit
[10:15:05] <tinco> perhaps two queries isn't so bad
[10:16:34] <tinco> thanks btw kali, I think it's the second time you've helped me here
[10:16:36] <kali> tinco: have you tried it ? because i think it actually does what you want
[10:28:43] <tinco> kali: http://privatepaste.com/c2799446b5 <-- see how it creates a second notification object, when the created at matches? or did I make a mistake?
[10:35:54] <Zelest> kali, when I have this array later on, {_id: ObjectId, to: [links1, links2, links3, ...]} .. can I efficiently get the number of links for let's say links3
[10:36:04] <Zelest> iirc, count() is expensive as fsck
[10:36:28] <kali> Zelest: there have been some improvements around count() when an index is present
[15:53:47] <ThiefMaster> hi, i'm trying to search documents using this condition: "somefield needs to contain all words from the search query". is there a nice way to do this using mapreduce or the aggregation pipeline? or should i use fulltext search instead?
[15:54:19] <ThiefMaster> (meh, fulltext-search is not an option since gentoo doesn't have an ebuild package for 2.6 :x)