[01:16:24] <Leech> hi, I have a map reduce that needs to run every day, and my main search engine uses the collection generated by the mr. What's the best way to avoid any search problems while I run the mr?
[01:17:08] <Leech> I was thinking in runnnig the mr to another collection and then delete search collection and rename the new one, but not sure about delete+rename timing
[09:28:37] <c3l> How do I find() several documents in a given order? That is, I have an array of ObjectIds and want to fetch documents in exactly this order. Right now I need to either make each DB request separately or manually sort the result afterwards...
[09:53:38] <kAworu> is it possible to use operators with $size ?
[09:54:46] <kAworu> If I want every document where the array property has a size bigger than three: db.foo.find({array: {$size: {$gt: 3}}})
[11:42:47] <greybrd> Nodex: requirement :-) . have added a new field in a map-reduce job which runs every hour. but still the existing documents need to be updated.
[11:44:10] <Nodex> can you not modify another field instead?
[11:52:10] <greybrd> Nodex: yes. other than _id I can modify.
[12:09:17] <Nodex> err, I was asking. Why can't you just modify another field
[12:09:58] <Leech> hi, I have a map reduce that needs to run every day, and my main search engine uses the collection generated by the mr. What's the best way to avoid any search problems while I run the mr?
[12:10:02] <Leech> I was thinking in runnnig the mr to another collection and then delete search collection and rename the new one, but not sure about delete+rename timing
[13:35:58] <mylord> performance: does it matter how long my document item names are? ie, packageName : “com.mysite.app” vs pn:”com.mysite.app”?
[13:37:35] <mylord> should i typically use, e..g “pn” instead of “packageName” where I, and would-be other views, can pretty easily figure out/remember what pn is? for performance/storage, or does the server remap those names to some optimized bit-mapping anyhow?
[13:41:43] <Nodex> mylord : it's avisable to shorten your keys where possible
[13:43:41] <mylord> k… should my rest paths typically be, e.g., /something/pn, or something/packageName ?
[13:51:23] <Indium> Anyone here with experience with the Java mongodb driver?
[13:51:44] <Nodex> mylord : that's really up to you, it's your app
[13:52:18] <cheeser> Indium: ask your question and see...
[13:55:58] <Nodex> There has to be at least one person in the room that uses Java :P
[13:56:33] <Indium> I'm doing a findandmodify to get a value and set a field to "processing" so the next time the same findandmodify will return the another row
[13:57:18] <Indium> (I use the find to get only rows that don't have the "processing" value set)
[13:57:26] <Indium> single threaded, this works like a charm
[13:58:26] <Indium> but with multiple threads, the same row gets fetched by all the threads
[13:59:15] <Indium> probably because of a concurrency cache problem
[14:07:32] <cheeser> you should never paste in to an irc channel
[14:24:32] <LoneSoldier728> Story.find({followers: {$nin: [user]}}, "_id name", {$sort: {date: -1}, skip: skipCount, limit: limit}, function(err, results) { I thought I was making a correct query here but for some reason it still shows stories that have the userId in it
[14:28:41] <Indium> the code: http://pastebin.com/Z45CHqk9
[14:54:17] <wc-> hi all, i have a list of embedded docs, is it possible to query for a field on one of those embedded docs and return only that embedded doc instead of the whole list?
[14:55:06] <Nodex> is it supposed to be an ObjectID ?
[14:55:20] <LoneSoldier728> the issue I am having is that the document has an array and it will have to check the whole array to make sure that objectId is not in it
[14:55:29] <LoneSoldier728> yeah an objectid, the users' objectid
[14:55:57] <Nodex> and you're sure that you're sending an ObjectId as [user] ?
[14:56:17] <LoneSoldier728> yeah i have it showing up as the userid in the console
[14:57:04] <Nodex> please pastebin what the console says
[15:02:56] <Nodex> it's easier to cast it in the query than migrate your DB / code
[15:04:54] <LoneSoldier728> I just converted the string to an objectid var user = mongoose.Types.ObjectId(req.query.userid);
[15:05:06] <LoneSoldier728> but still getting the same results
[15:05:48] <Nodex> unfortunatley you're going to have to pastebin a typical document and pastebin the actual query (the data) being sent to the server for debuggin
[16:21:52] <LoneSoldier728> Nodex because I figured that getting that mongo is much quicker in scanning for it rather than grabbing all results then looping through each array
[16:22:19] <rybnik> madalynn try the following mongo hostIP/database script.js > outputfile
[16:22:35] <Nodex> LoneSoldier728 : your query should be using $nin which just uses a btree to remove anything inside the array
[16:23:01] <rybnik> madalynn you might want to throw a --quiet in there
[16:23:11] <rybnik> madalynn does that solve your problem ?
[16:23:41] <LoneSoldier728> right that is what I am doing right now, but I was just saying it is better to have mongo remove the unnecessary documents than getting all results then doing it serverside
[16:23:51] <LoneSoldier728> in nodejs as oppose to my db
[16:28:36] <Nodex> In my opinion it's not better, there is no need to put that load on your app
[16:28:58] <madalynn> rybnik: can you specify credentials on the commandline as well?
[16:36:08] <rybnik> madalynn yes, but you've specified an invalid namespace (I believe). Anyway, to pass along your credentials use the -u and the -p flag on the command line to specify the required credentials
[16:40:07] <rybnik> madalynn care to send a pastie with the following: The command line invocation (please omit user credentials) and the script that you want to run
[18:23:57] <proteneer> i keep getting 2014-03-27T11:19:59.962-0700 [conn3] ERROR: SSL peer certificate validation failed:certificate not trusted
[18:24:41] <kesroesweyth> In v2.4.9, is there a way to update a document with a partial object from PHP and not blow away other object attributes that existed previously but weren't defined in the new object?
[18:25:50] <kesroesweyth> Like if my collection contained {field1: "value1,field2: "value2"} and I wanted to add {field2: "new value2",field3: "value 3"} without clobbering field1, if that makes sense.
[18:42:52] <kesroesweyth> The blog says that partial object updates are possible. I need to basically merge an object with an existing one in Mongo within a single document. Is this possible?
[18:50:22] <bluefoxxx> What is the correct way to aggregate data by reference in MongoDB?
[18:51:58] <bluefoxxx> i.e. if I have a document package={ 'name': 'handyman', 'discount': 0.15, 'bundle': [ ObjectId("11773355aabbccdd"), ObjectId("11559922ffaaccbb") ] }
[18:52:35] <bluefoxxx> and I want to pull a document that has 'bundle' set to an array of documents instead of ObjectId()
[18:52:49] <bluefoxxx> I can't figure out how to do it with mapReduce() or aggregate()
[18:53:00] <bluefoxxx> mapReduce says neither function should access the database
[19:09:14] <Nodex> bluefoxxx : references are a convienince, they don't actually do anything
[19:09:46] <Nodex> if you're using references then the chances are you're doing it wrong
[19:10:02] <bluefoxxx> we have many to many mapping.
[19:10:35] <bluefoxxx> our first attempt was in MySQL
[19:10:43] <Nodex> you're going to have to re-think your strategy
[19:10:47] <bluefoxxx> however the data set was natively XML with complex and variable schema.
[19:10:57] <bluefoxxx> and subfields. Which were of user-defined schema.
[19:11:27] <bluefoxxx> Somebody decided that some of those fields should be able to reference other stuff and we should be able to return the full content of that stuff, so ... many-to-many.
[19:12:20] <bluefoxxx> We've considered embedding the data, but it's single-data: if you update it, you wind up updating it in 300 places, not all of which you may be able to find
[19:12:39] <bluefoxxx> and of course this is a terrible idea
[22:51:30] <_Andres> h0bbit, Mongodb is like a siren. It sings a beautiful song that just sounds so irresistible. Getting started and storing your objects is so simple. Yet as time goes by and you start developing more complex relations between these objects.. it eats you alive.
[22:52:22] <h0bbit> _Andres, that's exactly my feeling right now.
[22:53:11] <h0bbit> my production server is failing, throwing more hardware at it doesn't work, mongodb docs are ambiguous, and there is no "support" to speak of.
[22:54:15] <_Andres> The docs are somewhat funny indeed, by the looks of it a lot of time has spent on it. Yet it lacks clear and concise examples
[22:54:15] <h0bbit> we've had trouble with mongodb before, but nothing of the kind I'm seeing today.
[23:05:57] <joannac> lorgio: i thought the entire point of mapreduce was that you couldn't pick an order that the results come back. There is a query and a sort so you can in theory, control the order things come in?
[23:06:18] <h0bbit> I have a bad secondary in my system, where my read operations are failing.
[23:06:57] <h0bbit> MMS graphs show me that a background flush has started on the system, and it has now been nearly an hour since any read on that machine has succeeded.
[23:07:25] <h0bbit> I want to pull the secondary out of the replica set, but everything in the docs seems to suggest that this will lead to a re-election
[23:07:38] <h0bbit> which will cause me to lose writes on the primary
[23:14:35] <h0bbit> I don't have the logs in front of me right now, but I do have the error emails. I'll get the logs in 5-10 minutes once my immediate problems have cooled down
[23:14:56] <h0bbit> also, what was even worse, the problem just started occuring on a different secondary
[23:19:08] <h0bbit> btw, we have seen this problem (background flush leading to read operations failing) once before as well. inevitably happens under peak load.
[23:19:34] <h0bbit> I don't know if the background flush is responsible, correlation != causation etc.
[23:20:14] <h0bbit> the last time, we were able to resolve it by forcing secondarypreferred on some of our app servers for a short while.
[23:20:30] <h0bbit> this time around, it's the secondary that's failing.