PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Friday the 29th of January, 2016

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[01:48:20] <dman777_alter> I checked node.js driver docs and haven't found anything yet....are there connection event listeners? likein mongoose MongoClient.connection.on('connected', function () {}), etc
[02:59:35] <dman777_alter> for logging verbosity, is update considered a component?
[03:26:36] <dman777_alter> for some reason push is not appending to my array pets. anyone know why? here is the debug: 2016-01-29T03:14:37.030+0000 I COMMAND [conn17] command curves.$cmd command: update { update: "users", updates: [ { q: { pets: [ { petType: "pig", name: "pear" } ], _id: ObjectId('56aad0a3ef5848c231ec80ed') }, u: { $push: { pets: "sssss" } }, upsert: false, multi: false } ], ordered: true, writeConcern: { w:
[03:26:42] <dman777_alter> 1 } } ntoskip:0 keyUpdates:0 writeConflicts:0 numYields:0 reslen:55 locks:{ Global: { acquireCount: { r: 1, w: 1 } }, Database: { acquireCount: { w: 1 } }, Collection: { acquireCount: { w: 1 } } } protocol:op_query 0ms
[03:26:46] <dman777_alter> sorrry
[03:26:49] <dman777_alter> sorry
[03:27:03] <dman777_alter> http://dpaste.com/101WWZF
[14:12:19] <__gilles> hi
[14:12:45] <__gilles> reading the doc http://docs.mongoengine.org/guide/querying.html there are operations you can perform against strings such as $iexact, $exact, $startswith, ...
[14:13:07] <__gilles> when trying to use them from pymongo, it fails with an OperationFailure: ... BadValue unknown operator
[14:13:24] <__gilles> do they have to be implemented using regex ?
[14:26:08] <GothAlice> __gilles: Those are MongoEngine ODM additions to the query syntax, not MongoDB options.
[14:26:19] <__gilles> okie
[14:26:30] <__gilles> thanks :)
[14:26:42] <GothAlice> __gilles: MongoEngine translates Document.objects(foo__startswith="bar") into a $regex query like: ^bar
[14:26:50] <GothAlice> Etc. for the various additions.
[14:27:10] <__gilles> 'k
[15:08:11] <jemershaw> I am trying to run a docker container of mongodb. I installed docker and can connect to the instance but the minute I try to create a new database it seems like it removes the new database. I can send the log when i try to create the database if that is helpful.
[15:34:55] <alexi5> hi guys and gals
[15:36:51] <alexi5> I have a document with structure showin in http://pastie.org/10700665. How do i query to find an documents with GsmSectors (Array) where Antenna(object) proprty Make is equal to Nortel ?
[15:37:24] <alexi5> http://pastie.org/10700665
[15:38:46] <GothAlice> alexi5: db.collectionNameHere.find({"GsmSectors.Antenna.Make": "Nortel"}) – you can even create an index on the field to speed up lookups. :)
[15:39:50] <alexi5> as simple as that
[15:39:54] <GothAlice> :)
[15:39:56] <alexi5> i was trying this : db.getCollection('sites').find({GsmSectors:{$elemMatch:{Antenna:{Make:'Nortel'}}}})
[15:40:04] <alexi5> but didn't get results
[15:40:32] <GothAlice> Yeah, you generally don't nest matching like that, because it means something subtly different than the shallow query with dot-notation fields.
[15:40:50] <alexi5> ok
[15:40:57] <GothAlice> You're instead querying for GsmSectors array elements whose Antenna field is exactly {Make:'Nortel'}.
[15:41:40] <alexi5> ok i understand
[15:43:57] <GothAlice> See also: https://docs.mongodb.org/manual/reference/operator/projection/positional/ – if you don't need the entire record and instead want to just get back just the single matching array element (if a single match is expected) from the overall document, plus whatever other fields you wish.
[15:45:26] <alexi5> thanks GothAlice
[15:45:34] <GothAlice> It never hurts to help. :)
[16:07:53] <dman777> any mongoose users here?
[16:08:39] <dman777> http://dpaste.com/34H7M17 I can not get update to append to my array pets
[16:09:07] <dman777> updated {"ok":1,"nModified":0,"n":0}
[16:10:35] <StephenLynx> mongoose is awful, you should stop using it.
[16:18:28] <dman777> StephenLynx: haha....sorry. just wanted one last try
[16:20:03] <dman777> StephenLynx: with the driver, how can I retain a open connection? all the examples for anything I do I have to open first and close when finished.
[16:20:20] <StephenLynx> you just don't close it.
[16:20:32] <StephenLynx> and pass that connection around.
[16:20:45] <dman777> StephenLynx: ya, that's exactly what I would like to do!
[16:20:49] <StephenLynx> so
[16:20:50] <StephenLynx> do it
[16:21:12] <StephenLynx> I like to get references to collections beforehand
[16:21:29] <StephenLynx> and pass these references instead of getting a reference to the collection every time
[16:21:52] <StephenLynx> gitgud.io/LynxChan/LynxChan if you wish to see how I do
[16:21:58] <StephenLynx> go to src/be/db.js
[16:23:35] <dman777> I haven't seen any examples on how to get a connection and pass it wround. I read the documentation on MongoClient
[16:24:15] <dman777> also, are there events on it like mongoose has such as mongoose.connection.on('disconnected', function () {})?
[16:25:21] <dman777> StephenLynx: thanks I will study your examples also today from your blog
[16:25:40] <StephenLynx> passing references isn't the driver's problem
[16:25:42] <dman777> oh...nm...not a blog
[16:25:59] <dman777> that's a pretty cool github page you have
[16:26:03] <dman777> never seen one like that
[16:26:04] <StephenLynx> you do that based on the tools the language provide you
[16:26:07] <StephenLynx> I don't use github.
[16:26:13] <dman777> ah
[16:26:15] <dman777> ok
[16:26:18] <StephenLynx> that is a site running gitlab's software.
[16:42:09] <fish_> I just delete my data directory to start over but now can't create the initial admin user. I suspect mongodb stores the info that localhost bypass is disable somewhere outside the data directory - is that true?
[16:45:46] <cheeser> fish_: nope
[16:46:07] <cheeser> two places to look: 1) the data dir 2) mongo.conf
[16:46:29] <fish_> yes checked both :/
[16:56:40] <fish_> it works for connecting to mongod, but not so mongos
[16:59:18] <fish_> oh great.. same as last time. I try and try this over and over, failing every single time. trying to authenticate and, as expected, returns an error
[16:59:30] <fish_> now I wait some time and suddently i can login with the credentials
[17:28:26] <jemershaw> I am running a docker instance of mongodb. I can connect to the instance but when i try to create a new db it shows this in the log writer worker 12] CMD: drop testdatabase.temp
[17:33:22] <fish_> 'caught exception while doing balance: could not get updated shard list from config server due to ExceededTimeLimit Operation timed out' <- any idea how to figure out which config server this is talking about?!
[17:34:33] <fish_> just recreated this cluster. adding shards worked just fine
[17:34:49] <fish_> but now sh.status() times out and I get those log issues
[17:35:30] <fish_> and manually I can connect to all nodes
[17:37:20] <fish_> and when i connect to the config server primary I can run sh.status()
[17:39:43] <skot> I suspect your problem is that where you are running the shell can't connect to things inside your docker instances.
[17:46:02] <StephenLynx> >using docker
[17:54:19] <dman777> StephenLynx: wow...using docker also? that's a cool setup you got going on
[17:54:36] <StephenLynx> you know what runs on my servers?
[17:54:43] <StephenLynx> the db, the runtime environment thats it.
[17:54:47] <dman777> oh wait, sorry...I just read the last line
[17:54:56] <StephenLynx> aside from the system, of course.
[17:55:57] <StephenLynx> these tools in general even might have a justifiable use, but most people using them are just clueless and go for fads.
[17:56:06] <dman777> lol
[17:56:08] <StephenLynx> and believe the more buzzwords they can spout, the better they are.
[17:56:19] <dman777> ya....where I am from alot of devs aren't really seeing the benifit of docker
[17:56:44] <StephenLynx> "OMG I USE MEAN STACK RUNNING ON A LOAD BALANCED NGINX DEPLOYED USING DOCKER MEMES MEMES MEMES MEMES MEMES MEMES"
[17:56:53] <dman777> hahaha
[17:57:06] <dman777> dude, that is funny...ya, that is what I would come across if I googled searched
[17:57:20] <StephenLynx> that is just the usual crap you get from webdevs.
[17:57:38] <StephenLynx> as a rule of thumb I always do the opposite of what is popular among webdevs.
[17:57:53] <dman777> ya, i got enough on my plate to learn. i have no use case for docker
[17:57:58] <StephenLynx> using node is the only exception, I think. but even then I use node in a completely different way the community does.
[18:02:31] <fish_> 12:49 < StephenLynx> these tools in general even might have a justifiable use, but most people using them are just clueless and go for fads.
[18:02:45] <fish_> ^- saying that in mongodb irc channel... :P
[18:03:29] <StephenLynx> I never denied there was an unjustified hype for mongo and people used it incorrectly because of that.
[18:03:37] <cheeser> a disparaging and arrogant sentiment
[18:03:58] <StephenLynx> along with at least 2 other people here, I have recommended rdbs for other cases
[18:05:07] <StephenLynx> same applies for node. many people using it don't understand what really are its strengths and use it incorrectly because of that.
[18:05:18] <StephenLynx> because understanding the strengths of a tool is also understanding its weakness.
[18:06:31] <StephenLynx> ffs, there are people building a whole OS as with node replacing bash
[18:06:36] <fish_> what I really don't understand is why I don't get mongodb running anymore.. I have the same cloudformation stack spinning up the same AMIs, yet somehow the cluster doesn't properly bootstrap and I get timeouts when trying to enable sharding :(
[18:07:12] <fish_> I could add shards just fine, but sh.enableSharding("my-db") gives me: "ok" : 0, "errmsg" : "Operation timed out", "code" : 50
[18:07:31] <fish_> same for sh.status() although I revived that after restarting all mongodb instances
[18:08:20] <fish_> and in the mongos log I get: "2016-01-29_18:01:58.85961 2016-01-29T18:01:58.859+0000 I SHARDING [Balancer] caught exception while doing balance: could not get updated shard list from config server due to ExceededTimeLimit Operation timed out
[18:08:48] <fish_> which isn't very help since it's not saying which config server it tries to talk to. the only thing I can say is that connecting to mongod on the config instances works just fine
[18:09:48] <fish_> any ideas? I'm kinda out of options than meditating over the logfiles some more
[18:11:17] <fish_> nothing too special going on. it has 5 shard + config servers, all 3 node replica sets
[18:14:42] <fish_> I still suspect it's somehow related to broken auth
[18:16:28] <fish_> actually now that I think about it, I think I never created a new cluster wiht 3.2.1, maybe there is some regression
[18:19:43] <fish_> https://jira.mongodb.org/browse/SERVER-22273 <- might have the same issue
[20:44:57] <Streemo_> hello
[20:46:00] <Streemo_> Is there a simple shorthand to search for a document if document.arrayField does not contain <string>?
[20:46:15] <Streemo_> shorthand without using $nin, etc.
[20:46:46] <Streemo_> for example this shorthand: {arrayField: <string>} will find a document *with* the string in the array, but I want the opposite
[20:48:16] <cheeser> $ne
[20:50:59] <Streemo_> well i was hoping to avoid that
[20:51:04] <Streemo_> i guess there's no shorthand?
[20:51:28] <Streemo_> i guess i could just do arrayField: {$ne: <string>}, but that is quite ugly
[20:51:31] <Streemo_> well not rly
[20:51:32] <Streemo_> -.-
[20:51:44] <Streemo_> makes me have less confidence in my code
[20:51:57] <Streemo_> whipping out those $fields