[09:39:32] <sudo_o> How can you filter by date to only get the last matching document using the aggregation framework?
[09:45:59] <Nodex> the latest matching doc or the last matching document?
[09:53:07] <sudo_o> the document in which the 'date' field is the largest
[09:54:03] <Nodex> that doesn't answer the question
[09:55:23] <sudo_o> if I do an aggregation on the key 'foo' two documents are matched, the documents have a `date` field on has yesterdays date and the other has the day before yesterday
[09:55:29] <sudo_o> I only want yesterdays document
[10:07:29] <jepoy> im setting up a multi region mongodb, 1 want a region to replicate to another region the there will be sharding within each region how can i start with that?
[10:08:02] <Nodex> you can tag replicas iirc, it's all in the docs, there is a good write up on data center awareness etc
[10:09:23] <jepoy> can you give me a link to that doc? sorry.
[10:12:15] <jepoy> i found the docs interesting and thank you so much
[15:04:51] <cheeser> you'd have to iterate the cursor in the shell and update each one
[15:04:52] <djlee> basically, all my "created_at" attributes are in a time period of a few seconds. i want to spread them out over a few weeks or months
[15:05:09] <djlee> ok cheeser no worries, thanks. new to mongo, so i guess i'll go read up on cursors :)
[15:05:11] <mathieue__1> i cant find an index to fix this:
[15:38:09] <blumpkin40> hey guys, i'm thinking about using mongodb for a testingtool. got the following data: https://gist.github.com/fuhlig/9116392 1) what do you think about storing such data in a nosql db 2) does this structure work well in mongodb 3) how to specific object like browser.name = chrome > viewport.width = 600
[15:47:24] <blumpkin40> and it returns the entire record
[15:57:33] <Joeskyyy> generic question for curiosity here: if you read the sentence "find all users whose age is 45", in your mind is that db.users.find({age:45}) or db.foo.find({"users.age":45}). Obviously this is dependent on the schema one is trying to achieve, so put that aside in your head, think generally.
[16:00:00] <AlexejK> Joeskyyy, I would have a collection for users and NOT a collection that contains a document with list of users..
[16:00:07] <AlexejK> basically because of the 16MB document limit
[16:00:16] <AlexejK> so 1 document per user in users collection
[16:00:31] <Joeskyyy> Excellent, exactly the opinions I'm looking for AlexejK thanks :D
[16:28:19] <sinisa> im stuck, my brain is exploding if someone can help :) .. colA , documents: {"group":"A","name":"nameA"},{"group":"B","name":"nameB"} .. i aggregate and sort it by "group", i need to group it in specific order from array for example groups["B","A"] ... how to do that?
[16:48:32] <jglover> Thinking about using Mongo for a project. I haven't really used it before, besides just for monkeying around with. Are there any definitive guides out there?
[16:48:34] <sinisa> how to group documents by predefined array ?
[16:49:13] <sinisa> jglover, just use it , definitive guides wont help if you dont understand how it works
[16:50:31] <jglover> sinisa: I'm really more interested in a document discussing when it's appropriate and when it's not. My only real constraint is that, with this project, a relational database won't work. So I'm looking for alternatives.
[16:51:10] <sinisa> relational database can work , why not?
[16:52:24] <jglover> sinisa:in this case, I won't be able to know the database schema beforehand, so an ORM is really out of the question, unless I generate code in a build file perhaps? It's too messy. I'm doing to try a document database
[16:53:04] <sinisa> mongo is ideal for this.. just push it in :)
[16:53:53] <jglover> sinisa: Alright, thanks for the info. The test cases I've worked with have been extremely successful.
[16:54:16] <sinisa> jglover.. how many records/documents it will contain
[16:54:48] <jglover> not sure yet. Thousands presumably.
[16:55:16] <sinisa> ok.. how many keys for each document
[16:55:55] <jglover> Not sure, that's set by whoever is creating the data. Could be one, could be 5.
[20:48:20] <zymogens> I see that mongod output goes to the mongo.log - is there any way to get that output to print out to the console instead?
[21:04:34] <andrewfree> Would I need denormalization on fields if I only set the field at initalization and it doesn't change? Or is the advantage in denormalization come from chaging that value at differentn points within an embeded/related structure?
[22:15:39] <sephreph> Hi, I'm using the .aggregate operation to summarize downloads we track based on IP address. I also store the file uploader's member ID as well as the downloader's member ID, and I wanted to exclude any records in my aggregation that had those matching (i.e. skip whe {memberID == ownerID}) but the only way I've found to do that is using $where which doesn't use indexes as far as I know. Any idea if it's possible to exclude resul
[22:45:28] <tripflex> aggregation was one of the hardest for me to wrap my head around (still kinda is)
[22:45:49] <tripflex> but once you havea good understanding of how it works and the available methods it makes it a lot easier to develop a plan
[22:45:57] <tripflex> i swear i watched that youtube video 30 times
[22:46:24] <sephreph> Yea, I've found the learning curve a bit steep but it really lets me get data out of the collections that I didn't think I could get out without processing it on the frontend, so I'm glad it exists!
[22:47:07] <tripflex> yeah, project will be one of your most used then
[22:47:12] <tripflex> if you read that first blog post i crated
[22:47:33] <tripflex> it shows how to take a document of products and return a new document with the count of each manufacturers product
[22:57:30] <tripflex> sephreph: here, you will probably find this useful