[01:11:12] <symbol> Resource authorization takes a minimum of two queries with Mongo, yeah? One to check for ownership and then the update?
[01:11:21] <symbol> I tried and findAndModify but the doc is complex.
[01:30:08] <Boomtime> "Resource authorization" <- what do you mean?
[01:30:47] <Boomtime> findAndModify is capable of a compare-and-swap action, this should suffice for most resouce acquisition type jobs
[01:34:13] <symbol> Boomtime: editing only id user owns the resource
[01:34:53] <symbol> I have a blog post with an array of comments that store the user id. I figured, I'd use findAndModify to query for the specific comment along with the user_id. If none is found, they don't own it.
[01:35:40] <symbol> Problem is my query check for comment.id and comment.user_id so the positional operator doesn't work for projecting back only the edited comment.
[01:39:12] <symbol> Seems like my best bet is to query for the comment and if it returns correctly perform the update.
[01:39:26] <symbol> correctly meaning that it exists
[02:39:04] <Boomtime> in reply to: "problem is my query check for comment.id and comment.user_id so the positional operator doesn't work for projecting back only the edited comment."
[02:49:48] <symbol> Technically, findAndModify suffices for the authorizing a user updating a comment.
[02:50:19] <symbol> Sometimes I wonder if I can even write English.
[03:04:31] <Jonno_FTW> in pymongo, does making a new MongoClient use a pool? Also, should I try to minimise the number of clients I make within a single program?
[03:27:33] <symbol> Jonno_FTW: I asked something similiar earlier for node.js. The driver should use a pool and yes you should limit connections. For node, I create one conncetion for the app.
[04:53:22] <Saif> ** WARNING: You are running in OpenVZ which can cause issues on versions of RHEL older than RHEL6.
[04:53:34] <Saif> ** WARNING: soft rlimits too low. rlimits set to 1024 processes, 64000 files. Number of processes should be at least 32000 : 0.5 times number of files.
[04:54:24] <Saif> I just bought a centos 6 64bit linux vps and installed mongodb. When I start mongo, it shows these errors.. Should I be worried??
[05:01:32] <joannac> the opsvz, I'm not sure about. But you should definitely fix your ulimits
[05:02:36] <Saif> its just a vps for testing, which have 1 cpu and 1 gigs of ram.. How much should I set ?
[05:09:16] <Saif> yeah.. I got something.. https://docs.mongodb.org/master/reference/ulimit/
[07:49:17] <the_german> Is there an equivalent to the fields option of mongoimport when importing json documents? I have to import millions of jsons but only certain fields if possible
[09:06:40] <the_german> If I insert document to another collection using find an forEeach. is there a way to only insert certain fields of the source doc to the new doc?
[09:20:59] <dbarrett> this link 404s but is linked to from google, is it something that should exist? https://docs.mongodb.org/v3.0/reference/aggregation/cond/
[09:24:14] <onebit> is it possible to update documents inside a collection using mongo hadoop streaming? seems there is MongoUpdateWritable if using java and MongoUpdateStorage if using pig
[09:26:17] <onebit> skimming through the code of the mongo hadoop connector i tend to say no, but not a java guy, so its quite possible that i missed something
[09:43:12] <diegoaguilar> Hello, can someone help with this Mongoose and geojson issue?
[10:42:16] <livcd> how does projection work exactly ?
[10:42:39] <Derick> just strips out the fields you don't want after selecting documents and before putting them on the wire
[10:55:23] <ams_> I'm not completely clear from https://docs.mongodb.org/manual/core/backups/. If I use LVM, I can create a snapshot of a still running Mongo instance?
[12:29:59] <deathanchor> ams_: you can use a command I think called fsynclock()>
[12:40:06] <deathanchor> it does cause the machine to stop updates though
[13:32:21] <Ahlee> Morning all, having some issues with a search, i want to find foo.bar1.baz and foo.bar2.baz, but I don't know what barN will be ahead of time. can somebody point me at how to do this without first running a query to pull barN, and then iterating over that list?
[14:23:14] <the_german> Is there an alternative to $unwind if i conditionally want to remove elements from an array using aggregation? I mean an equivalent to $pull for update
[14:35:55] <oskie> hello, 3.0.7: I have stopped a 1-node RS, copied all data files to a new node with different name, and now when I start it the node status is "REMOVED". How do I fix this without losing data on the new node?
[14:49:36] <oskie> got it - start without local database
[14:58:34] <stondo> I succesfully created a replicaSet with 1 Primary, 1 Secondary and 1 Arbiter
[14:59:06] <stondo> I have 3 users on admin db on primary
[14:59:16] <stondo> and can login without any problem
[14:59:54] <stondo> if primary goes down I expected two things: first, the secondary would become primary and second login would still be possible
[15:00:46] <stondo> but something is wrong, if I manually switch down master to test the awful scenario
[15:01:35] <stondo> should I create the use on both primary and secondary in detached mode?
[15:19:08] <spydon> I have the weirdest error, it works fine to save a document to mongo (using casbah), but when after I have retrieved it is deleted. I simply use findOne to retrieve it. Does this sound like any common newbie mistake?
[15:28:59] <the_german> Is there an alternative to $geonear for the aggregation framework? I need actually need to spherical indeces but I know I can only create one. So is there an alternative?
[15:29:38] <mylord> if I want normalization, what’s wrong with using another query to get item info details by id in another collection?
[15:32:52] <StephenLynx> how much performance you lose is up to how many additional queries you perform.
[15:33:04] <StephenLynx> there are acceptable compromises, though.
[15:33:21] <StephenLynx> and scenarios where nesting is not the optimal option.
[15:43:21] <Thinh> Hi guys--after shutting off a member to increase oplog size and rebooting it, the replication lag keeps on increasing and disk is 100% pegged
[15:43:34] <Thinh> anyone have any suggestions as to why this is?
[15:50:43] <mylord> how do 2 best case denormalized queries in mongo compare to same in 1 query of sql join? seems to me the performance hit wouldn’t be all that bad.. at worst 2x, after all, and probably not even that
[15:51:03] <mylord> the issue is more about additional race-condition concerns.. how to deal with those easily?
[16:10:30] <Dreamer3> how can i find the size of a binary field in a mapreduce?
[16:11:02] <Dreamer3> might help if i used the acutla field name :)
[17:13:30] <symbol> Is it really better to use shorter field names to lessen the amount of consumed memory?
[17:13:37] <symbol> e.g. desc instead of description
[19:13:20] <steeze> at what point should i do ranged pagination? (ie not using skip) ive seen a few people say it loses performance with scaling pretty quickly, but i read somewhere else that skip is probably fine up to 100's of thousands, maybe a million
[21:57:03] <Pacane> Hi, I'm trying to update the mongo driver for Dart, and I'm facing a weird problem. Once I'm authenticated, I try to insert/remove records from any collection and get error messages like this one: "err: not authorized to remove from dbname.collectionName"
[21:57:56] <Pacane> My mongo instance is a free tier mongolab, and my user has the role "DbOwner" (and I tried adding read/write too but it does the same thing)
[21:58:17] <Pacane> Is there some other permission the user needs in 3.x to insert/remove records?