[00:37:12] <Stephan__> Hi. How do I show only a specific field in my query? I don't want to find() based off anything, I want to show all entites but only show a certain field.
[00:39:41] <Stephan__> db.portfolio.distinct() works i suppose
[00:43:27] <joannac> assuming you want only distinct values, yes
[02:18:28] <rtablada> Hello all, I’m new to map reduce functions and more advanced queries in Mongo and was wondering how to do this? https://gist.github.com/rtablada/477a9190df73d1a7b333
[02:37:22] <joannac> rtablada: aggregation framework, $unwind, then $group with $addToSet
[03:05:02] <joannac> rtablada: then replace $addToSet with $push
[03:07:07] <joannac> rtablada: go read up on the aggregation framework: http://docs.mongodb.org/manual/reference/operator/aggregation/unwind/#pipe._S_unwind http://docs.mongodb.org/manual/reference/operator/aggregation/push/
[03:23:05] <rtablada> joannac, this is what I have so far, but it’s not quite what I’m looking for… https://gist.github.com/rtablada/477a9190df73d1a7b333#file-r1-js
[04:20:57] <joannac> rtablada: right, and what do you want?
[04:31:19] <rtablada> I’m just trying to get all of the viewDates across all documents as a single array
[04:34:27] <joannac> rtablada: yes, i understand what you want to do. I'm trying to help you work out how to do it
[04:35:30] <joannac> by asking you questions to try and get you to realise how to fix your aggregation
[04:40:55] <rtablada> I guess what I’m having problems with is the fact of I have a way to get the documents for the results.
[04:41:27] <rtablada> I guess from there I’m just looking for a way to flatten it to an array of just the viewDate.
[04:43:39] <joannac> rtablada: there is no confusion about what you're trying to achieve. I don't need more details
[04:44:46] <joannac> rtablada: if you want data from all documents, you should not be grouping on viewDate, which will give you results grouped by viewDate
[04:45:39] <rtablada> I think you get it, I’m just trying to figure out what tool would flatten the results I get from the first aggregate and make that an array the surrounding data isn’t relevant for my use case.
[04:46:31] <rtablada> Where I’m falling short and bashing my head is getting it down to that trim array rather than a full collection of result documents.
[04:49:55] <joannac> rtablada: you do not need anotehr tool. you can get something from the aggregation framework that's very close to what you want
[04:51:12] <rtablada> I realize that, but what I can’t figure out is what to pipe into after the $unwind that I have to get the result set that I’m expecting.
[04:57:59] <joannac> rtablada: try the following: 1. no group stage at all 2. group on user_name 3. read the docs on $group
[04:58:18] <joannac> the first 2 should help you actually understand what each section of the pipeline is doing
[04:59:04] <joannac> the docs tell you exactly what you should do if you want to group over all the documents in your collection rather than specify some constraint
[05:41:28] <drags> is it possible to run an rs.reconfig(cfg) to switch all members of a cluster at once? I have a "new" cluster of machines taking over for a replica set. The new cluster machines are sync'd as hidden secondaries.
[05:42:07] <drags> I want to run an rs.reconfig() from the current primary, but the document I'm giving it does not include itself in the new replica set (the document only has the new cluster members in it)
[05:48:14] <joannac> I don't think you can reconfig the current node out
[05:49:05] <joannac> why not do it in 2 steps? reconfig one of the new nodes to be highest priority and non-hidden, then reconfig from that node (which will be the primary) and config out the old nodes?
[10:28:11] <brano543> Hello, can anyone recommend me how can i solve an insert workload efficiently? I have a lots of data and the indexes are stored in the memory. Is there some way to solve this? One guy recommended me this,but i dont know what he means : "On some insert workloads, it is more efficient to drop the indexs, perform all the batch updates/imports and then reindex the collections in background."
[10:28:26] <brano543> he means taht i need to drop the index for the id that is created by default?
[19:13:11] <john__> Hi Kali. I seem to have fixed my corrumption on shutdown problem. I increased the shutdown timeout time in the Upstart script from 5 seconds to 50 and shutdowns now seem to work as I would expect.
[19:13:47] <john__> Thanks for your help yesterday.
[19:17:41] <kali> john__: good. thanks for the update
[19:19:20] <john__> I am not sure how long the shutdown actually takes but 10 seconds was not enough to consistently shutdown cleanly and at 50 it has worked every time.