PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Monday the 9th of March, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[01:40:30] <RizziCR> hi
[01:41:46] <RizziCR> how can i copy a database from my local develop vm to another server? i find only commands to request a clone from a remote, but i can’t access my vm not from the destination server.
[02:31:48] <dimon222_> i think you can mount some directory from your pc to vm and then mongodump db here
[02:32:15] <dimon222_> then you send this stuff to remote server and mongorestore
[02:32:43] <dimon222_> otherwise try to find way to enable internet access in VM and execute copydb
[02:33:25] <dimon222> talking to myself hm
[02:44:07] <cheeser> she left a while ago
[05:15:18] <suwaid> gents I have a query about this site
[05:15:26] <suwaid> https://thinkster.io/mean-stack-tutorial/
[05:15:50] <suwaid> I would like to know, how to link the posts variable to the service
[09:16:10] <amitprakash> Hi, I am running this query db.packages.aggregate([{'$match': filter_dict}, {$group: {_id: 'field', count: {$sum: 1}}}])
[09:17:03] <amitprakash> however, this throws the output _id: field, count: x, I'd instead want to see, field_value1, count: x, field_value2, count:y etc .. how do I go about doing this?
[09:17:25] <Derick> use '$field' instead of 'field'
[09:17:53] <amitprakash> Derick, what if its a compound field? such as field.attribute?
[09:17:58] <amitprakash> $field.$attribute?
[09:20:00] <Derick> '$field.attribute'
[09:20:23] <amitprakash> Derick, thank you so much!
[13:03:43] <alanhoff> Hello folks, would this query work? {status: {$gte: 0, $lte: 10, $not: 5}}
[13:03:56] <cheeser> what happened when you tried?
[13:18:13] <alanhoff> cheeser, I can't try right now, I have no access to the DB and I need to write the code :-(
[13:20:36] <cheeser> strange
[13:34:29] <inzenir> hello
[13:34:51] <inzenir> i have a question about functions and regular expressions
[13:35:19] <inzenir> for instance: in Page there are multiple fields, amongs them pageUrl, that is actually a regex
[13:36:07] <inzenir> i want to find a page that matches that regex, therefore i have a function that matches my url with regexes
[13:36:09] <inzenir> db.Page.find({$where : function() { var str = "Provision/Prikljucek/24235"; var regex = new RegExp(this.pageUrl); return regex.test(str) }});
[13:37:08] <inzenir> it seems to be working, but i get a positive hit, but also a fake-positive, meaning, i also get empty string as a positive match
[13:37:30] <inzenir> if i test that as regular javascript it doesn't hit me with false positives. any ideas on what am i doing wrong?
[13:45:40] <similian> blob in mongodb - yes/no ?
[13:46:41] <cheeser> gridfs
[13:48:58] <similian> cheers
[14:17:02] <Derick> cheeser: hah - I had no idea you were Justin :D
[14:17:19] <cheeser> oh. whoops! i guess that's a big gap. :D
[14:17:19] <Elad> Hi guys, anyone knows how to handle disconnects in the node.js driver? I am referring to the case where 1. I connect successfully 2. the network is down 3. I sent a query to the database.
[14:23:37] <Kota_> Just wondering if i can get a fresh pair of eyes on this, i'm getting an error because count() thinks that i'm giving it two arguments, but i don't see how. my query is {'$and': [{'$or': [{'uid': id}, {'ipaddr': self.http_headers['x-real-ip']}]}, {'date': {'$gt': validity}}]}
[14:24:32] <Kota_> i double checked brace by brace, and even my IDE shows that everything is in place properly nested
[14:27:29] <cheeser> (thanks Derick)
[14:29:53] <Derick> hope the spammer doesn't return though :/
[14:31:34] <fabiobatalha> Why I'm having this error message even my node is been setup as "isMaster" and "slaveOk(true)"
[14:31:50] <fabiobatalha> "errmsg" : "exception: nextSafe(): { $err: \"not master and slaveOk=false\", code: 13435 }",
[14:32:04] <fabiobatalha> I trying to do a copyDatabase
[14:35:41] <fabiobatalha> hummm. the source is not master.
[14:35:51] <fabiobatalha> it is working now!
[14:38:39] <Derick> good :-)
[14:42:30] <Kota_> guess I can't beat around the bush with my questions here. is there anything wrong with this query: {'$and': [{'$or': [{'uid': id}, {'ipaddr': self.http_headers['x-real-ip']}]}, {'date': {'$gt': validity}}]}
[14:42:49] <Kota_> anything that would cause count() to think it is two arguments?
[14:43:18] <Kota_> i cannot find anything syntactically wrong
[14:43:39] <Kota_> the lists and dictionaries are in the right places
[14:44:23] <Kota_> i only have one other query that is similar, but it does not incorporate $and, but it works fine
[14:46:32] <stiffler> hello
[14:47:04] <stiffler> how to store time in mongo? to do easy queries later? I would like to store time in format: hh:mm
[14:47:43] <cheeser> i would convert it an int
[14:47:58] <cheeser> use a 24 hour clock
[14:48:18] <stiffler> hmm...
[14:48:23] <stiffler> like 1630
[14:48:29] <cheeser> yeah
[14:48:31] <stiffler> 4:30 pm?
[14:48:50] <stiffler> and then how to check for example, the nearest time to current time ?
[14:48:53] <stiffler> closest
[14:48:55] <stiffler> I mean
[14:49:20] <cheeser> abs(now - then)
[14:50:25] <stiffler> abs?
[14:50:35] <cheeser> absolute value
[14:50:42] <cheeser> which isn't a mongo operator.
[14:51:34] <stiffler> so the closest time would be the lowest result of Math.abs ?
[14:52:35] <cheeser> right
[14:53:12] <stiffler> ok thanks. Its easier then solutions found on google
[15:12:36] <Kota_> nope. i have no idea. this query breaks the laws of physics i guess.
[15:17:08] <Kota_> cheeser: can i borrow your expertise for a bit?
[15:18:26] <cheeser> you can always try. i might not have anything applicable. :)
[15:19:14] <Kota_> cheeser: { '$and': [ { '$or' : [ { 'uid' : id }, { 'ipaddr' : self.http_headers['x-real-ip'] } ] } , { 'date' : { '$gt' : validity } } ] } - Pythons mongo driver seems to think this is two arguments when i plug it into count()
[15:20:03] <cheeser> the json looks fine when i reformatted it. not sure why python woulc complain.
[15:20:05] <Kota_> don't mind the spaces, I decided to use a converter afterwards (which produced the same query as I had originally designed to handle this problem)
[15:20:15] <Kota_> hmm
[15:20:34] <Kota_> i receive a TypeError: count() takes 1 positional argument but 2 were given - at that line
[15:21:22] <Kota_> unfortunately the documentation for the driver is rather limited, it would not explain any python differences when using nested lists and dictionaries in this manner
[15:23:05] <Kota_> although I do not see any reason for there to be any, nesting lists AND dictionaries inside of each other are perfectly legal
[15:39:54] <mongodbscum> hello mongodb assholes
[15:40:02] <mongodbscum> war goes on
[15:41:20] <assholes> hello mongodb assholes
[15:41:43] <cheeser> this is why ##java is +r
[15:43:27] <needhelp2> hello mongodb scum, @cheeser: are you asshole still licking the balls of Eliot?
[15:46:57] <ipv6-6ab> cheeser: you are so stupid, never seen such a lame administrator asshole like you, should be continue with this game? you are going to loose this game........well, MongoDB are the excrements scraped out of the vagina of Eliot Horowitz
[15:46:59] <ipv6-6ab> cheeser: you are so stupid, never seen such a lame administrator asshole like you, should be continue with this game? you are going to loose this game........well, MongoDB are the excrements scraped out of the vagina of Eliot Horowitz.
[15:47:00] <ipv6-6ab> cheeser: you are so stupid, never seen such a lame administrator asshole like you, should be continue with this game? you are going to loose this game........well, MongoDB are the excrements scraped out of the vagina of Eliot Horowitz..
[15:47:03] <ipv6-6ab> cheeser: you are so stupid, never seen such a lame administrator asshole like you, should be continue with this game? you are going to loose this game........well, MongoDB are the excrements scraped out of the vagina of Eliot Horowitz...
[15:52:33] <GothAlice> cheeser: Indeed, +r is a useful thing.
[15:53:19] <GothAlice> OTOH, at the same time as it inconveniences abusers, it also inconveniences inexpert IRC users who are otherwise just looking for assistance. :/
[15:54:07] <cheeser> yeah. but it hasn't been an issue overall for us there. most find their way in. and those that can't be bothered probably are more work than they're worth...
[15:58:28] <fewknow> blamo
[16:01:07] <flyingkiwi> o.O so mongodb inc has enemies... (or at least one single crazy guy..). but i'm curious - what happened? why is there lowbrow "war"?
[16:02:45] <cheeser> just some random wanker with nothing better to do.
[16:03:10] <GothAlice> flyingkiwi: Something happened, from what I gather/suspect he lost his job after he lost some data after mis-using MongoDB, and blames MongoDB for his own inability to RTFM. Either that or it kicked his dog, or stole his wife. Possibly, since this person keeps referencing the 10gen CEO, they may be a spurned lover. Such conjecture is an amusing way to spend time, but we may never know.
[16:19:22] <flyingby> GothAlice, scum like you should get shot or hanged at the next tree...lol spurned lover......time to call for action and remove scum like from the earth
[16:19:27] <flyingby> you useless asshole
[16:20:02] <Derick> sigh
[16:20:24] <GothAlice> So much typing… but only two clicks to kick/ban. The effort ratio here clearly indicates a winner, Derick. ;)
[16:22:51] <Pavion> hello guys
[16:25:04] <standby2> Derick, GothAlice I will cut your testicles and feed them as food to swine....good food for MongoDB pigs, you are the most horrible IT scum on this planet, crawl back into the vagina of Eliot, that's where the MongoDB is coming from, you are useless assholes, ALL MONGODGB USERS ARE ASSHOLE!!!!!!!!!!!!!!!! FUCK MONGODB, YOU ARE SCUM!!!!!!
[16:25:05] <standby2> Derick, GothAlice I will cut your testicles and feed them as food to swine....good food for MongoDB pigs, you are the most horrible IT scum on this planet, crawl back into the vagina of Eliot, that's where the MongoDB is coming from, you are useless assholes, ALL MONGODGB USERS ARE ASSHOLE!!!!!!!!!!!!!!!! FUCK MONGODB, YOU ARE SCUM!!!!!!
[16:25:07] <standby2> .
[16:25:41] <GothAlice> Pavion: Howdy! Don't mind the troll. ;)
[16:26:05] <Derick> GothAlice: I'm going to turn on the OPN feature that you need to register your nick before you get voice
[16:26:13] <Derick> (pending approval by marketing)
[16:26:41] <GothAlice> Derick: Indeed. Need to make sure to have a chanserv welcome message that indicates you need a registered nick.
[16:26:54] <Derick> yeah - I do need to figure out how to do that :)
[16:27:31] <GothAlice> Derick: /msg chanserv set #mongodb ENTRYMSG <message>
[16:27:32] <GothAlice> :)
[16:27:41] <Derick> thanks :-)
[16:30:59] <docker-boy> The MongoDB scum is calling for marketing approvoal? You need to ask the scum of the scum of MongoDB Inc? What a fucker organization, you scum should better go and herd sheep, Inbred MongoDB scum
[16:31:27] <quattr8> -_-
[16:32:33] <quattr8> he’s been here for a few days, very persistant lol
[16:32:55] <GothAlice> quattr8: He's been around for two or three _weeks_ that I'm aware of. Very persistent! ^_^;
[16:37:59] <crm-today> hi dudes
[16:38:00] <Number6> GothAlice: Persistent and rather annoying
[16:38:08] <Derick> let's hope my new flags work
[16:38:58] <Derick> hi crm-today
[16:39:17] <Kota_> what a mook. it never ceases to amaze me how some people waste their lives pursuing such trivial nonsense.
[16:39:36] <Derick> i know!
[16:39:40] <Kota_> what is he trying to accomplish? making someone on the internet cry? pfffft
[16:39:52] <Derick> so - from now on, people need to have been registered with nickserv in order to speak
[16:40:18] <Derick> crm-today: that means you need to register too
[16:40:40] <Kota_> most software help channels do that, that's why I always take my +r with me whilst travelling ^^
[16:41:08] <Derick> i haven't set it as +r, just as +q $~a
[16:41:18] <Kota_> also crm-today is that troll apparently, just got a rather nasty pm suggesting he might remove my testicles.
[16:41:25] <Derick> Kota_: ok
[16:41:42] <Derick> i was afraid of that
[16:41:46] <Kota_> i like my testicles, thank you very much
[16:42:38] <Kota_> Derick: is there an official python driver for mongo?
[16:42:42] <Derick> certainly
[16:42:52] <Kota_> let me guess, it is not pymongo?
[16:42:52] <Derick> http://docs.mongodb.org/ecosystem/drivers/python/
[16:42:56] <Derick> it is! :)
[16:43:00] <Kota_> oh.
[16:43:15] <Kota_> should I file a bug report somewheres then?
[16:43:38] <Derick> yes: https://jira.mongodb.org/browse/PYTHON/
[16:43:46] <Derick> that is, if you have found a bug :)
[16:44:08] <Kota_> it was with the query {'$and': [{'$or': [{'uid': id}, {'ipaddr': self.http_headers['x-real-ip']}]}, {'date': {'$gt': validity}}]} - count() seems to think it is two queries, unless there is an error that i have yet to find
[16:44:20] <Kota_> two arguments rather
[16:44:23] <Derick> Kota_: can you show the full example code line?
[16:44:33] <Kota_> myself and cheeser could not find an error
[16:44:37] <Kota_> sure
[16:44:50] <Kota_> attempts = DB.connect().attempts.count({'$and': [{'$or': [{'uid': id}, {'ipaddr': self.http_headers['x-real-ip']}]}, {'date': {'$gt': validity}}]})
[16:44:58] <Derick> oh, if cheeser couldn't find it - just file the report ;-)
[16:45:24] <Kota_> i mentioned before i only have one similar working query, and it does not include an $and subquery
[16:45:30] <Kota_> okay
[16:47:58] <DerickTest> testing
[16:49:56] <Kota_> it would just seem odd that this hasn't been encountered, it's not a very complex query
[16:50:44] <Derick> yeah, it's odd
[16:52:18] <Kota_> Derick: where might i find the release date of the 3.0 driver?
[16:52:26] <Derick> we don't know yet
[16:52:35] <Kota_> according to pip i'm on 2.8 still, i might try updating first
[16:52:40] <Kota_> OH gotcha
[16:53:10] <Kota_> it's in the compat list i wasn't sure if it was released or not
[16:54:22] <Kota_> is there a more roundabout way i might be able to execute this query? can i call len() on a dict cursor?
[16:54:33] <Kota_> or do i have to use the count() function
[16:54:51] <Derick> count() would be way more performant I think
[16:54:59] <Derick> but I don't really know the python driver
[16:55:21] <Kota_> i just need something in the mean time while the bug report is reviewed
[16:56:28] <Kota_> yeah, no can't call that on the cursor. hmmm
[16:57:45] <Kota_> well the query works when called via find()
[16:59:18] <GothAlice> Kota_: Hmm, I've never tried to issue a query _within_ the count() call before, I always chain off the lazy query set returned by find().
[17:01:28] <Kota_> o.o that might work better
[17:02:01] <Kota_> i sort of self teach myself using the docs, but I initially learned via the PHP driver. i was not aware you could chain the command
[17:02:18] <Derick> Kota_: the PHP driver also allows that, btw
[17:02:30] <Kota_> neat
[17:02:47] <GothAlice> Kota_: http://api.mongodb.org/python/current/api/pymongo/cursor.html#pymongo.cursor.Cursor.count
[17:03:17] <GothAlice> find() and friends return a Cursor, Cursor also has various methods like limit/skip, sort, etc.
[17:27:49] <cheeser> ah, peace and quiet. thanks Derick
[17:30:05] <RWOverdijk> I'm finding myself in a bit of a contradiction. http://mongodb.github.com/node-mongodb-native/ says I should specify `near: { type: "Point", coordinates: [ ] }` while the source of the node.js lib specifies: https://github.com/mongodb/node-mongodb-native/blob/2.0/lib/collection.js#L1622 they both do indeed return different results... What am I missing?
[17:35:44] <RWOverdijk> My nick's registered, are my messages getting through?
[17:37:24] <cheeser> RWOverdijk: nope! ;)
[17:37:38] <Boomtime> RWOverdijk: I don't know node.js very well but I can certainly recognize the two variants you mention
[17:37:45] <Boomtime> you may find your answer here: http://docs.mongodb.org/manual/reference/operator/query/near/#op._S_near
[17:42:03] <RWOverdijk> "legacy coordinates"
[17:42:32] <RWOverdijk> Does that imply I should use the notation which includes type: "point"?
[17:42:58] <Boomtime> RWOverdijk: i believe that is more likely what you want, but i don't know your use case or node.js very well
[17:43:05] <RWOverdijk> Boomtime, The difference in results is in the distance.
[17:43:07] <RWOverdijk> Ah
[17:43:12] <Boomtime> bingo
[17:43:17] <RWOverdijk> I simply want to sort by distance, and also get the distance.
[17:44:07] <RWOverdijk> One returns 1504304.5323377722 and the other returns 0.23585464830243683
[17:44:28] <RWOverdijk> I can't see the correlation between the two
[17:44:59] <RWOverdijk> And "legacy" sounds like "don't use this!"
[17:47:00] <RWOverdijk> Oh by the way, I'm using near within geoNear. I'm still a bit fuzzy on why they're documented individually
[17:56:27] <Derek57> Hi there everyone! Got a quick question if that's alright. :) Has anyone been experiencing major crash issues with Mongo 3 and WiredTiger? I'm having some big problems and I can't seem to solve them.
[19:47:03] <GothAlice> Ah, it's nice when a good index choice presents itself. (230 records/sec. before index to 520 records/sec processing after the index.)
[20:07:15] <Derick> GothAlice: it's eerily quiet...
[20:07:28] <GothAlice> Heh. Derick: Looks like the voice option worked.
[20:07:36] <GothAlice> (I noticed him connect and disconnect at least twice. ;)
[20:07:42] <Derick> well, not really if nobody actually asks questions ;-)
[20:07:45] <GothAlice> XP
[20:29:47] <in2rd> Good afternoon. I'm curious to know, and have been unable to find in documentation, if you can pass a client certificate to a SSL-enabled mongod via connection string?
[20:30:39] <in2rd> Trying to connect to my instance via the Node.js driver, and need to use connection string for configuration.
[21:09:41] <MacWinner> hi, i'm planning on setting up a secondary datacenter that will host a MongoDB replica set member.. I wantedt to know what sort of network latencies are acceptable for the replication traffic
[21:09:58] <MacWinner> right now the ping tests show 18ms RTT to the datacenter i'm evaluating
[21:23:24] <GothAlice> MacWinner: 18ms isn't bad. It really comes down to what your application (or users) expect. If you read from the secondary, and there's a 20ms lag, that secondary represents reality 20ms ago. Recent writes (i.e. if you issue an insert/update, then _immediately_ query the secondary) might not appear there in time. For some applications, this is perfectly acceptable.
[21:24:21] <GothAlice> For most applications, though, you'll need to evaluate and tune each query for how fresh it must be. Direct "must be current" requests to the primary, and basically everything else at a secondary.
[21:27:59] <MacWinner> got it.. thanks..
[21:30:52] <GothAlice> MacWinner: As a note, for my at-work dataset I have a replica in an alternate DC (~12ms latency) and two in the office (~120ms latency, the second is delayed by 24h.) All three of these are configured to never be elected as a primary, for obvious reasons. ;)
[21:31:02] <GothAlice> The in-office ones are "offsite backups" only.
[21:31:36] <MacWinner> how did it get delayed by 24h?
[21:31:53] <GothAlice> MacWinner: http://docs.mongodb.org/manual/core/replica-set-delayed-member/
[21:32:18] <GothAlice> We have a delayed member for the main reason given on that page: to recover from human error. ;)
[21:33:11] <MacWinner> wow.. that's pretty cool
[21:33:52] <GothAlice> If one decides to go for ranges 24h and above, it's very important to tune your oplog size. If the delay exceeds the oplog capacity, badness will ensue.
[21:34:33] <MacWinner> really neat feature.. didn't notice it.. this mongo guys have really thought of everything practical
[21:34:54] <MacWinner> whenever I think, "I wish mongo did...".. it always seems to do it
[21:36:17] <GothAlice> Well, almost everything. There are some outstanding tickets on JIRA that clearly indicate the MongoDB coders are human. ;) A lack of useful binary operations in searches, inability to treat ObjectIds as dates (for $year/$month/etc. projections), and query timeouts applied to everything except tailing cursors are a few of the ones that have bit me, personally.
[21:37:09] <GothAlice> I see something like $year (and the other date projections) and think, damn, that's really useful. But then not having explicit creation date/time fields bit me because the date projections don't work on ObjectId (_id previously being used by my code as the creation time.)
[21:37:35] <GothAlice> … makes me think, yeah, useful, but someone forgot a few things when implementing it. ;)
[21:37:37] <MacWinner> i haven't gotten to that level yet:)
[21:39:19] <GothAlice> #FirstWorldMongoDBProblems ;^D