PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Friday the 26th of February, 2016

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[03:43:00] <Saul_Jaramillo> hey guys, quick question, im trying to add a shard from a mongos, im getting this as a response "errmsg" : "could not find host matching read preference { mode: \"primary\" } for set r0",
[03:44:07] <Saul_Jaramillo> and if i do show logs in rs0:primary, i get [initandlisten] connection accepted from ... #9 (3 connections now open)
[03:44:53] <Saul_Jaramillo> and of course the read pref in the rs0 is set to primary
[03:45:50] <Saul_Jaramillo> according to -> printjson(db.getMongo().getReadPref())
[03:46:07] <Saul_Jaramillo> any ideas what could be the problem?
[04:04:52] <Saul_Jaramillo> oh nevermind, i figured it out, now im getting this, "errmsg" : "not authorized on admin to execute command { listDatabases: 1 }", when running the sh.addShard command, but if i go traight from the shell i can perfectly connect to the replica with the specified credentials, is there a specific access or role that needs to be added to this user? (current role is root and db:admin)
[04:04:57] <Saul_Jaramillo> thankz in advances
[04:11:57] <dman777_alter> if I index a string field, will the lookup on it still be slower than a objectId field?
[05:08:52] <Saul_Jaramillo> ok last question, i keep getting this on my logs in the mongos: SHARDING [Balancer] caught exception while doing balance: Server's sharding metadata manager failed to initialize and will remain in this state until the instance is manually reset :: caused by :: unable to resolve DNS for host ... <-- mongos and configsvr are running on docker containers in aws, the replica set is running at
[05:08:52] <Saul_Jaramillo> home in a windows machine (testing only), any ideas whos missing the dns entry or what to do?
[10:33:05] <dddh> http://www.computerworld.com/article/2541481/data-center/the-top-10-dead--or-dying--computer-skills.html
[10:33:52] <dddh> 2. nonrelational dbms
[10:37:22] <amcsi_work> if I index ref_column.$id, is that valid?
[10:37:52] <kurushiyama> dddh: It is not exactly a new article.
[10:38:42] <dddh> kurushiyama: they didn't know about NoSQL ..
[10:45:00] <Sagar> Hello, i am using mongodb and i am running a mongodb query to count db entries using foreach but its taking a lot of time and making pages not to load almost. Anyway i can fast foreach query and make things go alot more faster?
[10:45:06] <Sagar> want to add up the index assuming every user database has a $user['click'] = and i want to add them up foreach $userlinks as $links { $total += $links['click'] and so on...
[10:45:23] <Derick> Sagar: a foreach to do a count means reading all the data
[10:45:30] <Derick> you can just use the "count" command
[10:45:58] <Sagar> Derick: i want to add up the index assuming every user database has a $user['click'] = and i want to add them up foreach $userlinks as $links { $total += $links['click'] and so on.
[10:46:05] <Derick> "the index" ?
[10:46:12] <kurushiyama> dddh: Cassandra was released in 2008, Couch in 2010 and Mongo in 2009
[10:46:27] <Derick> oh, you want to sum the values in all the links fields?
[10:46:32] <Sagar> yes
[10:46:38] <Derick> you seem to be using PHP - care to post the whols example on pastebin?
[10:46:58] <Sagar> you mean the script?
[10:47:17] <Derick> yes
[10:48:29] <Sagar> Derick: http://pastebin.com/1uEuxiB6
[10:51:14] <kurushiyama> Sagar: I might be a total PHP illiterate, but do I get it right that you sort by a field ("clicks", namely) within your code?
[10:52:04] <Sagar> kurushiyama: yes once total is out, i try to sort them via that function to list them as ascending to desending
[10:52:50] <kurushiyama> Sagar: That can be done by MongoDB, too, saving code and (most likely) enhancing performance.
[10:53:03] <Sagar> kurushiyama: how?
[10:54:30] <kurushiyama> Sagar: As said, I can barely read this, but it looks to me like a client side aggregation. If said aggregation is done on the MongoDB side, a $sort stage would do the trick. But again – Derick for sure will be more helpful here. It was just something I noticed.
[10:55:20] <Sagar> Yes. i am waiting for him. The reason i chose MongoDB and not MySQL was for scalability and dynamic updates that can easily come up in mongodb.
[10:59:30] <kurushiyama> Sagar: Maybe it would help if you described in non-technical terms what kind of aggregation(s) you are trying to achieve here. A sample doc and the expected output would not hurt, either.
[11:00:27] <Sagar> Kurushiyama: I am trying to count clicks of users. For each unique link they send their users from social media, the click is udpated on their link in the db and a tracker for userip is also inserted.
[11:01:12] <kurushiyama> Sagar: Hm...
[11:01:14] <Sagar> So its goes like, u visit a unique link and then the click is updated in the field. { clicks: 1 } and then i have to show on their dashboard who are the top then click givers by using foreach
[11:03:40] <Sagar> Derick: any updates?
[11:09:03] <kurushiyama> Sagar: So you basically want something like this: http://pastebin.com/VmzE12az ?
[11:10:34] <Sagar> Yes almost the same
[11:11:12] <kurushiyama> Sagar: Well. You see that it can be achieved by a relatively simple aggregagtion.
[11:11:40] <Sagar> how can that be done in php? avoiding the foreach?
[11:11:53] <kurushiyama> Sagar: That is an aggregation.
[11:12:01] <kurushiyama> Sagar: it is server side exectuted
[11:12:33] <kurushiyama> Sagar: https://docs.mongodb.org/manual/aggregation/
[11:13:08] <kurushiyama> Sagar: My suggestion: construct your aggregation on the shell first, then "translate" it to PHP.
[11:20:24] <Sagar> kurushiyama: That would be difficult for me
[11:20:39] <Sagar> I will wait for Derick may be he has a better solution for me
[11:20:45] <kurushiyama> Sagar: Why that?
[11:21:13] <Derick> Sagar: sorry, got distracted
[11:21:45] <Derick> Sagar: I was hoping for just a small part of it, not the whole thing!
[11:22:39] <Sagar> Derick: A small help would be enough.
[11:22:48] <Sagar> Kurushiyama: I am new in making the translations
[11:22:50] <Derick> Sagar: what kurushiyama makes most sense, do the aggregation on the shell first
[11:22:56] <Derick> +says
[11:23:06] <Derick> sorry, I can't read this PHP code either
[11:23:22] <kurushiyama> Sagar: A good place to start.
[11:23:32] <kurushiyama> Sagar: And the best of times ;)
[11:23:53] <kurushiyama> Derick: Wasnt there a webinar recently about Aggregations?
[11:24:37] <kurushiyama> Sagar: https://www.mongodb.com/presentations/webinar-exploring-aggregation-framework
[11:25:24] <Sagar> Derick: you were going to say the same thing?
[11:25:28] <Derick> Sagar: you're also running an extra query for *every* user, in line 52. That sounds like a relational anti-pattern to me
[11:25:55] <kurushiyama> Sagar: It is one of the most powerful features of MongoDB. Even without replication and scalability, the aggregation framework alone would make MongoDB a good choice for a lot of things.
[11:27:05] <kurushiyama> Sagar: And you can always come to this friendly channel for assistance.
[11:32:12] <Sagar> Derick: the line 52 verifies if the user has links or not
[11:32:52] <Sagar> kurushiyama, Derick: What i do now, please help me with making an easy to use and fast script, what and where should i make modifications?
[11:35:01] <Derick> Sagar: you need to show your data documents first
[11:35:10] <Derick> I don't know how they look like...
[11:35:33] <Sagar> show i show u one of my field?
[11:35:43] <Sagar> example
[11:36:04] <Derick> a document from both the user and user_links collection please
[11:38:15] <Sagar> Document from user_links: http://pastebin.com/SFWMpqeb
[11:40:09] <Sagar> Document for users: http://pastebin.com/eh8JiMy1
[11:40:19] <Derick> Sagar: a few tips about that one, store date in ISO8601 format (YYYY-mm-dd) (or a MongoDB), and timestamp and generated as a MongoDate
[11:40:20] <Sagar> This is how i want my script to work:
[11:40:52] <Derick> and in that one, dob in ISO8601, and timestamp and registered in MongoDate again
[11:40:53] <Sagar> Derick: i am using MongoDate in php and both date() as well
[11:41:13] <Derick> Sagar: that's not what you store in your documents though. You're storing strings.
[11:41:16] <Sagar> the reason to stoy that way date or dob is their is simple use so i dont want to fetch them
[11:41:41] <Derick> fetch them? I don't understand what you mean
[11:41:52] <Sagar> I mean it's not required
[11:42:03] <Sagar> "timestamp": "2016-01-30T18:36:14.245Z", (It uses new MongoDate())
[11:42:10] <Sagar> basically what i want my script to do
[11:42:17] <Derick> you probably also should not regnerate uids sequentially yourself but use the default objectid
[11:42:48] <Derick> ok, I missed the the timestamp was like that, because you're not showing documents through the shell, but I suppose thorugh json_encode one?
[11:43:10] <Sagar> 1) Find users which has status approved. 2) Then check if user has generated links or not. 3) If generated, get all links of users, and add all of the users links "clicks" as total. 4) then arrange them in decending order
[11:43:43] <Sagar> Derick: showing throught shell? i fetch data using php like u saw in my script
[11:43:57] <Derick> Sagar: will only approved users have links?
[11:44:06] <Sagar> Yes
[11:44:14] <Derick> so step 1 isn't necessary then
[11:44:26] <kurushiyama> Sagar: I'd do it just the other way around. Do the aggregation over all clicks, save it into a new collection using the out stage, and for the top X, find the according users which are approved
[11:44:34] <Sagar> it is, because user status can be approved,banned,verified,pending
[11:44:34] <Derick> kurushiyama: I was getting there ;-)
[11:44:49] <Derick> Sagar: you just said only approved users have links
[11:45:02] <kurushiyama> Derick: Sorry. Interrupting a socratic teaching is... inexcusable. Sorry again.
[11:45:20] <Derick> kurushiyama: :P
[11:45:34] <Sagar> Derick: yes only approved users have links, but it depends if they had generated links or not, its not complasory they have generated a link
[11:45:52] <Derick> Sagar: sure, but in that case, do you want these users in the list at all?
[11:46:52] <Sagar> so first we cannot fetch $Mongo->users->find(); we want to make $Mongo->users-find(array("status"=>"approved")); because only approved users will be able to generate links, once we confirm the user status is approved, we have to check they have generated atleast 1 link
[11:47:29] <Derick> Sagar: yes, but as you say, there is *no* item in user_links for a user, if they are not approved.
[11:47:45] <Derick> so the checking for approved users first isn't needed
[11:47:45] <Sagar> Yes
[11:48:42] <Sagar> Derick: $Mongo->users-find(array("status"=>"approved")); at first helps to calculate the users which can generate links, if we do $Mongo->users->find(); it will get all users which are not even needed.
[11:48:53] <Derick> I know
[11:49:12] <Derick> but if you query in user_links, you won't find links for users that aren't approved *anyway*
[11:49:29] <kurushiyama> Derick: Might have sth to do with the song I just heard: https://youtu.be/p7mfEeQaAM0
[11:49:53] <Derick> hehe
[11:50:04] <Sagar> Derick: Line 25 makes it possible get approved users, making sure the item in user_links may or may not have for approved users.
[11:50:29] <Derick> Sagar: i know, I can read the code. But so far, you haven't contradicted this statement yet:
[11:50:33] <Derick> 11:42 <@Derick> but if you query in user_links, you won't find links for users that aren't approved *anyway*
[11:51:10] <Sagar> The reason to get users with approved status because they are the only one with capability of having links. The part could be they can generate links and cannot, so we have to make sure that they have atleast one link.
[11:51:39] <kurushiyama> Sagar: This is well understood.
[11:52:00] <kurushiyama> Sagar: But make a step back for a second. Forget your code. Forget even MongoDB
[11:52:17] <Sagar> So i am doing that part right since i want to first get list of users which has approved status then check if they have a link or not
[11:52:21] <Derick> Sagar: if there is a link in user_links, then the "uid" links to the user that generated the link, right?
[11:52:36] <Sagar> Yes
[11:53:30] <Derick> so can you find all the users with links, by just doing a (in SQL speak) SELECT DISTINCT uid FROM user_links ?
[12:04:42] <Sagar> Derick: you mean finding all links with a particular user id?
[12:06:17] <Derick> no, finding all users with links
[12:06:31] <Derick> SELECT DISTINCT uid FROM user_links
[12:06:51] <Derick> not SELECT * FROM user_links WHERE uid = 131 (which finds all links for a user id)
[12:07:01] <Sagar> Oh you mean i should find links directly
[12:07:04] <Sagar> no need to get users?
[12:07:25] <Sagar> But again, once i get all links, i have to get users details from the user ID
[12:08:02] <Sagar> Assume i first get all links, then i have to use uid to get username and other details as well
[12:11:40] <Derick> Sagar: yes
[12:11:51] <Derick> if you *need* all the other details that is
[12:12:01] <Derick> Sagar: which mongodb version are you using?
[12:12:42] <Sagar> MongoDB shell version: 3.2.3
[12:13:23] <Derick> ok, good
[12:13:30] <Derick> so, you can do all of this in *one* query
[12:14:42] <Derick> but with multiple aggregation pipeline steps. Step 1: group all the link clicks into a bucket per user; 2. sort by decending order. 3, lookup the users to go with it
[12:15:02] <Derick> It is best to try this one, by one
[12:18:17] <Sagar> Derick: Help with the script, like i told you i am new to this, i will really appreciate that
[12:18:27] <Derick> yeah, one sec
[12:18:55] <Sagar> let me give you a clean script
[12:20:13] <Sagar> Derick: http://pastebin.com/sT1DfyaA
[12:24:22] <Derick> Sagar: step 1: http://pastebin.com/9sthL5k5
[12:34:14] <Sagar> Derick: So we ar creating group for each user for links?
[12:36:56] <Derick> Sagar: yes
[12:37:35] <Derick> the group is identified by a *new* _id: » '_id' => '$uid', /* We group by UID */ «
[12:37:56] <Derick> Sagar: out for a run now, back in ~1 hours
[12:38:31] <Sagar> Derick: :| Can u help this sort first, my website is already live and users are not getting stats updated
[12:40:35] <kurushiyama> Sagar: You gotta be kiddin – you are working on live production servers?
[12:42:23] <kurushiyama> Sagar: If I were you, I'd fire up a maintenance page asap and inform your customers equally asap.
[12:43:20] <Sagar> kurushiyama: Yes
[12:45:08] <kurushiyama> Sagar: This is about as no-no as it can get. Sadly, I can not help you – I can barely read PHP, much less write it.
[12:45:39] <synapse> Sagar what's wrong?
[12:47:05] <kurushiyama> synapse: Quick overview: Derick and Sagar were creating an aggregation as replacement for an iteration over all documents client side, and there are in between the stages. Bad thing is that Derick is afk and the code seems to be changed on production.
[12:47:52] <kurushiyama> synapse: And I can not help because of my absence of any PHP skill.
[12:48:14] <synapse> Sagar owns the servers, he was taking advice from someone on IRC and now said person has gone, left him in the lerch and the servers are live?
[12:48:42] <kurushiyama> synapse: Yep, that pretty much sums it up.
[12:48:59] <synapse> Well then I hope Sagar has learned a very valuable lesson
[12:51:04] <kurushiyama> To defend Derick: Sagar only told us that those servers were life after Derick announced his afk
[12:51:42] <Sagar> :| Well i didn't updated anything kurishiyama : all i am saying the issue of iteration is coming, i dont modify codes till the time i can make those work
[12:52:45] <kurushiyama> Sagar: Good luck for you. But you said there were not status updates any more?
[13:20:22] <Sagar> kurushiyama: status updates?
[13:20:29] <Sagar> @Derick: are you back?
[13:20:55] <kurushiyama> Sagar: I . can. not. help. you. No PHP here.
[13:21:24] <Sagar> :| ok
[14:04:01] <Sagar> i am getting Fatal error: Call to undefined method MongoCursor::aggregate()
[14:04:16] <Sagar> i have 1.6.12 mongodb driver already loaded, i checked in php info
[15:03:53] <synthmeat> hooked up mongodb to mathematica. friggin' awesome.
[15:04:04] <synthmeat> BI tools? hah. don't make me laugh.
[15:06:09] <Sagar> @Derick: are you back?
[15:42:42] <domo> does anyone have any recommendations for a stack that implements event sourcing?
[15:42:46] <domo> besides geteventstore.com
[15:43:03] <StephenLynx> >full stack
[15:43:06] <StephenLynx> thats bad
[15:43:40] <domo> ok then, less is ok too
[15:44:44] <StephenLynx> and what you linked
[15:44:46] <StephenLynx> is not a stack
[15:44:49] <StephenLynx> is a database.
[15:45:10] <StephenLynx> a stack would be a complete set of software serving a high-level purpose.
[15:45:20] <StephenLynx> which might include or not a database.
[15:47:13] <domo> it's not just a database tho
[15:47:30] <StephenLynx> >The open-source, functional database with
[15:48:56] <StephenLynx> kek the devs don't have a RHEL repository.
[15:49:23] <StephenLynx> >(without mono statically linked)
[15:49:45] <StephenLynx> hold on, don't tell me they are developing a server side software with linux not being the primary focus?
[15:50:26] <StephenLynx> oh lawdy, their primary platform is windows
[15:50:27] <StephenLynx> RIP
[15:50:28] <domo> what? no
[15:50:32] <domo> dude, slow down
[15:50:42] <StephenLynx> https://github.com/eventstore/eventstore
[15:50:51] <StephenLynx> > It can run either on Mono or .NET
[15:51:02] <domo> I know
[15:51:07] <StephenLynx> so its focused on windows.
[15:51:11] <domo> dude, again, slow down
[15:51:13] <StephenLynx> with linux being an after thought.
[15:51:31] <domo> I said no to you asking if we were going to use/develop with this software
[15:51:45] <StephenLynx> never asked this.
[15:51:55] <domo> ah, *they*
[15:51:55] <StephenLynx> I am just ripping on eventstore
[15:52:01] <domo> regardless, no to both ;)
[15:53:07] <StephenLynx> ok, what exactly you need from a database?
[15:53:18] <StephenLynx> I already hope you are not considering eventstore.
[15:53:24] <StephenLynx> I see red flags all over it.
[15:53:35] <domo> yeah I'm not
[15:56:44] <Sagar> I want to do the agreegate in 2 manners
[15:56:53] <Sagar> first i want to fetch all the data from the collection using the date
[15:57:11] <Sagar> and then group them according to their uids
[15:58:16] <StephenLynx> by uids you mean
[15:58:19] <StephenLynx> the _id?
[15:59:14] <Sagar> no
[15:59:34] <StephenLynx> you set a different field with an uid on your documents?
[16:00:33] <Sagar> $pipeline = [ '$group' => [ '_id' => '$uid', 'clicks' => [ '$sum' => '$clicks' ], ] ];
[16:00:43] <Sagar> this is what i am using to group as uid and then total the clicks
[16:00:57] <Sagar> i am struck before this one, how to i fetch the data using particular date
[16:01:15] <StephenLynx> gt,lt, gt, lte
[16:01:16] <StephenLynx> but
[16:01:19] <StephenLynx> if your uid is unique
[16:01:35] <Sagar> uid is unique yes
[16:01:38] <StephenLynx> then how you can group by it? no documents will share the same uid
[16:01:48] <StephenLynx> grouping by an unique field is pointless.
[16:01:50] <Sagar> :| uid is not unique
[16:01:59] <StephenLynx> hm
[16:02:03] <StephenLynx> you confused?
[16:02:10] <Sagar> A bit
[16:02:13] <StephenLynx> >Sagar> uid is unique yes
[16:02:21] <Sagar> it's not sorry my bad
[16:02:25] <StephenLynx> >Sagar> :| uid is not unique
[16:02:30] <Sagar> first i want to fetch all data depending upon the date
[16:02:30] <StephenLynx> so
[16:02:35] <StephenLynx> your UNIQUE id
[16:02:40] <StephenLynx> is not unique?
[16:02:43] <Sagar> nope
[16:02:49] <Sagar> then group them according to uid
[16:03:02] <StephenLynx> why do you have a field with an uid that is not unique?
[16:03:11] <StephenLynx> are you referencing a different document?
[16:04:26] <Sagar> i have documents like this http://pastebin.com/f6LsxgAi
[16:04:45] <Sagar> 1st i want to fetch them depending upon their "date"
[16:04:49] <Sagar> after getting the documents
[16:04:59] <Sagar> i want to group all the documents by similiar uid and add the total of clicks
[16:05:23] <StephenLynx> you should store dates as dates.
[16:05:25] <StephenLynx> and not as strings.
[16:05:38] <StephenLynx> its easier to query and do stuff when they are actual dates.
[16:05:53] <StephenLynx> and why is your unique id not unique?
[16:05:56] <StephenLynx> that makes no sense.
[16:05:58] <Sagar> you see the "timestamp"
[16:06:04] <Sagar> they are still dates as dates
[16:06:06] <StephenLynx> why is your _id just a regular integer?
[16:06:20] <StephenLynx> thats a timestamp.
[16:06:21] <StephenLynx> not a date.
[16:06:33] <Sagar> _id is an incrementing unique id
[16:06:49] <StephenLynx> { "creation" : ISODate("2016-02-23T15:39:58.404Z") }
[16:06:54] <StephenLynx> this is an actual date.
[16:07:00] <StephenLynx> why is an incrementing _id?
[16:07:09] <StephenLynx> you have more work and less tools doing that
[16:07:23] <Ange7> hey
[16:07:32] <Ange7> is it possible to have a sort on string field with mongodb ?
[16:07:37] <StephenLynx> yes
[16:08:41] <shlant> hi all. I have mongodump as a cron job and I keep getting emails from cron with output that show this: https://gist.github.com/MrMMorris/9775ab52d223da4825db. Is mongodump sending output to stderr when it shouldn't be? I have it as `mongodump -h bfoo -d bar 1>/dev/null`. Adding —quiet did nothing at all.
[16:08:46] <Sagar> StephenLynx: that "timestamp" is generated by new MongoDate()
[16:09:32] <StephenLynx> is that PHP?
[16:09:55] <Sagar> Yes
[16:09:57] <StephenLynx> your driver is FUBAR if a date is saving a string to the database.
[16:10:11] <StephenLynx> I already showed you how it should be if it were an actual date.
[16:37:28] <kurushiyama> StephenLynx: FUBAR... Havent heard that for a loong time...
[17:17:39] <tantamount> Is it correct to index the $id part of a DBRef instead of the entire DBRef?
[18:44:40] <dddh> isn't find_one and find the same if there is unique index on this field?
[18:46:08] <StephenLynx> find one just uses a limit(1) and returns the document
[18:46:15] <StephenLynx> no changes regarding indexing.
[18:47:14] <Doyle> When a foreground index is created, does the log entry say foreground?
[19:00:21] <dddh> StephenLynx: it's lame, there should be CBO ;(
[19:02:51] <StephenLynx> wot
[19:05:20] <synapse> hi StephenLynx
[19:05:25] <StephenLynx> hey
[19:05:43] <synapse> how's things? still working on Lynxchan?
[19:05:59] <StephenLynx> yeah
[19:06:05] <StephenLynx> bunkerchan.org adopted it
[19:06:09] <StephenLynx> 1.5.2 comes out tomorrow
[19:07:34] <synapse> Oh neat
[19:07:45] <synapse> Is that what your spending most time on atm?
[19:08:25] <StephenLynx> yeah
[19:08:34] <StephenLynx> nothing to do at my job for nearly 2 months now :v
[19:08:40] <synapse> I've been looking at the source
[19:09:08] <synapse> After taking a look at your code I earned some inspiration out of it. I've started rewriting my project and I'm keeping it procedural and as modular as I can. I just finished writing the first script, mind doing a glance over to critique?
[19:09:18] <synapse> Just a simple initialisation
[19:10:17] <StephenLynx> past it and ill check after eating
[19:10:21] <StephenLynx> paste*
[19:11:44] <synapse> nice one, http://pastebin.ca/3382706
[19:12:02] <synapse> always appreciate tips from someone who's more experienced
[19:23:40] <StephenLynx> >function initConfig(PROJECT_ROOT_DIR, callback){
[19:23:44] <StephenLynx> nothing exactly wrong, but
[19:23:56] <StephenLynx> usually that format for variable names is for constants.
[19:24:10] <StephenLynx> so it might be misleading to use it for a function parameter
[19:24:42] <StephenLynx> and you really could use with a smaller tab size. 8 is a bit excessive.
[19:25:11] <StephenLynx> else {
[19:25:28] <cheeser> you should be using spaces anyway. :)
[19:25:30] <StephenLynx> it would be easier to read if you put it right after the closing bracket from the previous condition
[19:25:31] <StephenLynx> he is
[19:25:40] <StephenLynx> but hes using with 8 spaces
[19:26:31] <StephenLynx> and your lines get too long around 130
[19:27:19] <cheeser> oh! ugh.
[19:27:46] <StephenLynx> >module.exports = initConfig;
[19:27:54] <StephenLynx> this is really limiting, though.
[19:28:11] <StephenLynx> now your whole module has just a single public handle.
[19:28:34] <StephenLynx> instead you could just write exports.initConfig = function (){};
[19:28:57] <StephenLynx> in general is alright.
[19:29:02] <StephenLynx> keeping it simple.
[19:29:06] <StephenLynx> and easy to read.
[19:48:09] <synapse> Nice, thanks for the glance over! I'l double check my editor is set to do spaces not tabs
[19:52:28] <StephenLynx> wait, but you are using spaces.
[19:52:53] <synapse> I was hitting the tab button
[19:53:01] <synapse> but the editor wasn't set to tab as spaces
[19:53:08] <synapse> I changed that
[19:53:25] <StephenLynx> it was setting tab as spaecs
[19:53:30] <StephenLynx> 8 spaces to be precise.
[19:53:36] <StephenLynx> the problem is the amount of spaces
[19:53:36] <synapse> It's not the best editor, which one do you use StephenLynx? I'm just using notepad++ atm
[19:53:43] <StephenLynx> eclipse
[19:53:48] <StephenLynx> with nodeclipse installed
[19:53:54] <synapse> oh that sounds nice
[19:54:03] <StephenLynx> is a bit janky, but integrated lint and the formatting options make up for it.
[19:54:15] <StephenLynx> I even ship those on my projects
[19:54:19] <StephenLynx> in case you wish to copy them
[19:54:20] <synapse> yeah I was gonna hunt for an IDE that had integrated lint
[19:54:34] <StephenLynx> I never run my projects through eclipse though
[19:54:39] <StephenLynx> I just edit the code
[19:54:53] <synapse> mmm yeah
[19:58:44] <synapse> re: your work StephenLynx are you a little worried about the lack of workload? that would be on my mind a little if it were me
[19:59:16] <StephenLynx> :v
[19:59:17] <StephenLynx> v:
[19:59:22] <StephenLynx> a little.
[19:59:28] <StephenLynx> but not too much
[19:59:40] <StephenLynx> im the only dude here capable of maintaining a vital C project.
[20:00:02] <StephenLynx> and there is a new thing with a client using lynxchan too
[20:00:23] <synapse> But if your permanent contract it's not so bad as every company wants a loyal dev on the team, here in England 'contracting' is very common / popular and people really do come and go in that sector, but the permanent contracts are always the last to ever be affected
[20:01:02] <Doyle> Hey. When a foreground index is being built on a sharded cluster (3.0), I know mongos processes that require a global op like list indexes get stalled, but can those processes block other queries at the mongos level?
[20:01:23] <StephenLynx> synapse, yeah, I am your equivalent of a permanent contract.
[20:01:44] <StephenLynx> here people usually work as if they were a company
[20:01:49] <StephenLynx> of if they were an actual person.
[20:02:03] <StephenLynx> the first gives you more freedom and less security. also less taxes I guess.
[20:02:16] <StephenLynx> the second gives more benefits, more taxes and less freedom
[20:02:29] <synapse> yeah we have a similar set up
[20:02:34] <StephenLynx> you can dismiss a companies services easily
[20:02:41] <StephenLynx> but not so easily with a person.
[20:02:50] <StephenLynx> because there is a fund and shit
[20:03:06] <synapse> In the world of software dev, the "work as a company" is very popular, much harder to get permanent contracts
[20:03:28] <StephenLynx> :3
[20:04:34] <synapse> as here the work as a company option tends to mean you fill 'jobs' on short term contracts, but many times I see "short term" people stay on for years, they get comfy and then bam they're out the door, the upside is they do earn more but it's less secure
[20:05:36] <synapse> Hell at one point here, these short term contracts were sweeping the nation it was so bad as many of them were exploitative contracts, new legislation was needed
[20:06:02] <synapse> Because employers could word things in a way to stop having to pay for sick, holiday, pensions etc etc
[20:06:45] <synapse> The market isn't as crazy as it once was though, it's getting better
[20:12:10] <StephenLynx> there is one thing good about here
[20:12:19] <StephenLynx> is that we had laws to cover that for about
[20:12:27] <StephenLynx> dunno, 60 years now?
[20:22:41] <synapse> StephenLynx It's crazy to think we didn't have them, but they were never exploited before until recently so there was no real "demand" for the legislation (that's kinda how it works here) if enough people from the right sect of society shouts about something, something gets changed
[20:23:08] <synapse> I emphasize "the right people" too
[20:24:13] <StephenLynx> what happened here
[20:24:26] <StephenLynx> is that we had a populist civil dictator of sorts.
[20:24:30] <StephenLynx> getulio vargas.
[20:24:47] <StephenLynx> from what I heard, he was the main responsible for these laws.
[20:25:07] <synapse> Ahh I see
[21:30:07] <Axy> hey all
[21:30:15] <Axy> is it possible to create an auto incrementing field in mongodb
[21:31:50] <dddh> Axy: actually next ObjectId is always greater than current
[21:35:31] <Axy> ddh --- some time ago I've made an auto incremental field for my mongodb based store for my random bsons
[21:35:45] <Axy> the thing is, I just checked and the workaround seems pretty crap to me now
[21:35:55] <Axy> (storing the counters in another place and such)
[21:35:59] <Axy> I mean it's all manual
[21:36:20] <Axy> then I remembered that the reason I did it this was is because there was no way to do a true auto incremental field
[21:36:29] <Axy> Well I need to call the nth document sometimes
[21:36:30] <dddh> in sql you have to use sequences with triggers
[21:42:11] <dddh> Axy: https://docs.mongodb.org/manual/tutorial/create-an-auto-incrementing-field/
[22:16:27] <sandrosantos> Hey guys. It's possible to access mongodb directly with angularjs?
[22:34:05] <dman777_alter> hello
[22:36:41] <dman777_alter> if I create a multikey index on a array.....and I add to the array later, does it automatically index the new values?
[22:52:39] <dddh> dman777_alter: yes
[22:54:57] <dman777_alter> dddh: on https://docs.mongodb.org/v3.0/tutorial/model-embedded-one-to-many-relationships-between-documents/ example for the first pattern, is the book aray indexed in the publisher document?
[22:55:46] <dman777_alter> sorry, I mean this link https://docs.mongodb.org/v3.0/tutorial/model-referenced-one-to-many-relationships-between-documents/
[22:56:22] <dman777_alter> Is the books: [12346789, 234567890, ...] a multi key indexed array?
[23:36:30] <dddh> dman777 ..