PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Monday the 9th of June, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:14:46] <JamesHarrison> just downgraded from 2.6.1 to 2.4.10 and all those slow queries taking 1500+ms are now taking 10-20ms again. Guess there's a regression in 2.6 somewhere? Will give it some more time before upgrading and try and reproduce the fault in development
[00:15:08] <JamesHarrison> (performance in dev with smaller test dataset was fine, only saw sudden nosedive in performance when upgrading production)
[02:43:46] <dman777_alter> http://bpaste.net/show/fPV7uQ4fzsfJRKlYSFOT/ when I insert this json string into my database(mongoose mongodb), I get Possibly unhandled TypeError: Cannot read property 'data' of undefined
[02:43:50] <dman777_alter> would the 0 in data: 0 be considered undefined?
[02:47:27] <ehershey> dman777_alter: 0 shouldn't be undefined
[02:47:49] <ehershey> I bet there's some other context that would be useful
[02:48:09] <ehershey> like can you also show the actual code you're inserting it with?
[02:49:42] <ehershey> I can insert that json document using the mongo shell
[02:49:48] <ehershey> so it may be a code issue
[02:50:02] <ehershey> or mongoose config if there is such a thing
[02:50:49] <dman777_alter> ehershey: I figured it out...sorry. it was codeing error. Writing strings for model, schema, and the function to create the document can be rather intensive...is there a way to check for contradictions in the syntax? the errors are can be pretty generic and don't give exact locations
[02:52:20] <dman777_alter> ehershey: how do you insert a json document into the mogno shell?
[02:54:14] <ehershey> I just pasted it
[02:54:30] <ehershey> db.<connection name>.insert(<paste document>)
[02:56:50] <dman777_alter> ehershey: thanks. I am new to node js and mongo. What type of logging do you use to a file? Is there a way I can throw errors and have a logger catch it instead of writing logger.warn(), etc?
[03:02:35] <ehershey> sounds like maybe more of a node/mongoose/app style question than I can answer well
[03:03:11] <ehershey> but yeah you should be able to do things like that
[03:03:42] <ehershey> http://www.joyent.com/developers/node/design/errors
[03:04:17] <usr> Does mongodb have its own language
[03:04:20] <usr> like MySQL
[03:04:30] <usr> Or it only accessible through drivers
[03:04:33] <usr> just curious
[03:05:01] <dman777_alter> ehershey: nice...thanks.
[03:06:23] <dman777_alter> usr: mongodb is accessiable through drivers like mongoose or mongodb driver, or the shell.
[03:06:36] <usr> yea I use pymongo
[03:06:43] <usr> the shell is a driver as well
[03:07:08] <dman777_alter> usr: the language would be json string/objects with the ability to write custom functions nested in the json properties and such.
[03:07:31] <usr> Yeah I realize that but it doesn't have its own query language?
[03:07:37] <cheeser> it does
[03:07:45] <usr> What is it
[03:07:53] <cheeser> did you check the website?
[03:07:58] <usr> yea
[03:08:09] <cheeser> it's all there
[03:08:51] <usr> link?
[03:08:55] <usr> inb4 mongodb.com
[03:09:54] <cheeser> inb4?
[03:10:13] <usr> in before you give me http://www.mongodb.com
[03:10:40] <cheeser> http://docs.mongodb.org/manual/reference/operator/
[03:10:55] <ehershey> dman777_alter: no problem
[03:10:55] <cheeser> .org is the community site. .com the corporate
[03:11:01] <usr> thanks
[03:11:49] <dman777_alter> anyone use mongoose on here? #mongoose.js is always dead
[03:12:13] <usr> pymongo only
[03:12:58] <dman777_alter> usr: I'm coming from python webservers myself.
[03:13:25] <usr> use tornado
[03:13:50] <dman777_alter> usr: I use django and flask...most django. But I am switching to Node.
[03:15:37] <usr> You should switch to tornado instead dman777_alter
[03:16:13] <usr> I don't see why you would switch to node since u know python
[03:19:19] <dman777_alter> usr: haha....painfull learning because my new team wants it. But also because of the native concurancy and websockets/SSE.
[03:19:50] <usr> Tornado has websockets/ssse
[03:19:51] <usr> as well
[03:21:10] <dman777_alter> usr: ya, but I go with the flow :) I liked django alot, wish it was up to date in that area.
[03:21:33] <usr> have you showed your team tornado?
[03:23:37] <dman777_alter> usr: ya.... but it's kinda long story. But I think the websockets implementation is best in Node.js. With uwsgi and such it becomes a little hack ish.
[03:24:20] <usr> ah kk
[03:24:30] <usr> can i ask what type of application you're developing?
[03:24:57] <dman777_alter> usr: various apps...not just one. Just really depends what comes up.
[03:25:50] <usr> oh kk
[03:27:22] <usr> My team is switching to mongodb because MySQL relational Databases have become such a pain
[03:29:31] <dman777_alter> usr: I used to do lightweight MySql stuff. I liked it. I like Mongo also...I need to get used to writing really long json objects.
[03:30:00] <dman777_alter> I think my hand was going to fall off from the schemas I wrote
[03:30:06] <dman777_alter> lol
[03:30:40] <usr> lol
[03:30:44] <usr> yea i'm trying to get use to it too
[03:53:46] <usr> How do I leave a document parameter empty? I want an empty array so i can add values to it later
[03:54:11] <usr> It's a dynamic index array that will point to another document
[04:01:50] <usr> Like is a place holder necessary?
[07:58:05] <freeMind> Hi everybody
[07:58:05] <freeMind> I have a question what is the best way to manipulate a multiple duplicated subdocument in mongoDB?
[07:58:05] <freeMind> I will explain myself I have Person collection witch can have, as many addresses as he want so I will have something like
[07:58:05] <freeMind> https://dpaste.de/kcBS
[07:58:05] <freeMind> is there any correct way to this
[07:58:05] <freeMind> ??
[08:36:00] <AlexejK> freeMind, why not create an array of Address objects?
[08:37:18] <freeMind> AlexejK, i was just about to ask about it (just found it on the internet so i will have somthing like https://dpaste.de/ZUnd
[08:37:22] <freeMind> thats correct?
[08:37:45] <AlexejK> yepp seems logical.. however I would still put a limit on addresses
[08:38:00] <AlexejK> because of the document size limit (unlickely for you to hit it, but still
[08:38:09] <AlexejK> *unlikely
[08:39:24] <freeMind> AlexejK, ok i'll do it thanks for your help :)
[08:39:42] <freeMind> much appreciated :)
[08:43:10] <AlexejK> np :-)
[08:52:10] <deerdancer> i'm trying to use $redact in aggregate command but it throws me an exception showing unrecognized pipeline stage name '$redact'. i couldn't even find this on google! any pointers on this?
[09:02:32] <AlexejK> just a stupid question.. are you on Mongo 2.6?
[09:02:57] <AlexejK> as this is new in 2.6 (just like the doc says)
[09:05:21] <AlexejK> deerdancer, it would also help if you provide the example of a failing command
[09:18:42] <deerdancer> @AlexejK yes, here's the command with it's error - http://pastebin.com/FCjmuHVq
[09:19:27] <AlexejK> can you also please check output of db.version() (when you are in mongo shell).. Both client server I think have to be on 2.6.+
[09:19:43] <deerdancer> @AlexejK yes, i'm on 2.6
[09:20:01] <deerdancer> @AlexejK , oh. i'm sorry it's 2.4.9.
[09:20:16] <AlexejK> deerdancer: there is your reason
[09:20:33] <deerdancer> AlexejK: will get back after trying it on 2.6
[09:20:48] <deerdancer> @AlexejK thanks!
[09:20:53] <AlexejK> np :-)
[10:04:10] <the_drow> How do I install only the mongodb shell?
[10:25:14] <og01_> usr: /win 4
[10:26:38] <og01_> oops
[10:41:05] <srt> Anyone know if I can connect to a mongodb cluster v2.4.5 using a mongos v2.6 on another server?
[15:39:46] <gancl> Hi! Why I can't save mongoose? Users.findOne({"name": sUser if not found new new Users({name: sUser and save. But the client alerts "message":"Cannot call method 'save' of null", although the data is saved
[15:43:42] <gancl> OK now. if (err || userDoc == null) { I should use "else" before save another fuction
[17:08:20] <daidoji> hello, quick question for anyone on
[17:08:54] <daidoji> is BSON a compressed format when using mongodump, or can I get gains from compressing as part of the backup process?
[17:09:46] <cheeser> it is not compressed
[17:10:46] <daidoji> cheeser: word thanks
[17:22:23] <michaelchum> Hi, I have a huge collection and I would like to delete certain documents with a specific field and value, i.e. I would like to delete the results of db.collection.find({"myfield":"myvalue"}) , what would be the simplest way to do so? Thanks!
[17:30:06] <daidoji> michaelchum: http://docs.mongodb.org/manual/reference/method/db.collection.remove/
[17:30:34] <michaelchum> Thanks! Just figured out
[17:30:44] <daidoji> cheeser: when using mongodump does the '-o -' option work for you to output to stdout?
[17:30:47] <daidoji> michaelchum: np
[17:35:50] <daidoji> or anyone for that matter? I'm passing 'mongodump -d database -c collection -o -' but nothing is going to stdout
[17:39:42] <cheeser> daidoji: works for me
[17:40:47] <daidoji> cheeser: you're running 2.6.0?
[17:41:13] <cheeser> 2.6.1
[17:41:43] <daidoji> cheeser: whoops, I feel stupid now
[17:41:49] <daidoji> collection I was dumping was empty
[17:41:51] <daidoji> sorry about that
[17:41:57] <cheeser> ha! :D
[17:42:37] <daidoji> man tar
[17:42:39] <daidoji> oops
[17:46:12] <daidoji> cheeser: so to backup (with compression) my whole db, I've got to mongodump -o - | tar -cfj my whole collection?
[17:46:21] <daidoji> err every collection?
[17:46:44] <daidoji> or is there a better way?
[17:51:55] <daidoji> hmm, I guess not :-( https://jira.mongodb.org/browse/SERVER-5190
[17:52:01] <cheeser> you can dump a whole db at once, iirc
[17:54:33] <daidoji> well I mean I can do mongodump alone which gives me a dump directory, but I'd really like to mongodump -o - | compression program type of thing which doesn't seem possible atm
[19:42:33] <betty> Is it possible to fetch a function from system.js?
[20:04:32] <andrewp> Hey folks, got a question about changing the mongo service entry on windows. Our mongod service currently uses explicit --dbpath and --logpath flags and I'm moving to a config file setup instead. I'm aware that I can have the dev team run reg update hklm\system\...blabla, but if I just had folks re-run the mongod --install with the updated params, would that also work?
[20:24:42] <daidoji> is it really the opinion of Mongo team that we turn atime off?
[20:24:44] <daidoji> http://docs.mongodb.org/manual/administration/production-notes/
[20:24:48] <daidoji> on a linux system?
[20:25:29] <cheeser> would appear so
[20:26:36] <daidoji> is that really a good call?
[20:27:16] <cheeser> no idea. but apparently so.
[20:27:29] <cheeser> you're free to disregard that advice and see if you have an actual problem.
[20:29:35] <joshua> If you don't have an exact need for it, then its a good thing to just turn off
[20:29:54] <daidoji> cheeser: well I'm just on my dev machine, but turning off atime seems like a bad call to the *nix neckbeard buried deep inside me
[20:30:04] <cheeser> then don't
[20:30:12] <daidoji> cheeser: well yeah, just curious
[20:31:01] <cheeser> half the text around that is "if you have perf problems" so it sounds like you could probably skip it. on the other hand, sounds like a decent preventative measure
[20:31:32] <joshua> On some newer OS the defaults include relatime instead of atime
[20:47:59] <andrewp> A follow up question regarding config files, too
[20:48:10] <andrewp> http://docs.mongodb.org/manual/reference/configuration-options/#config-file-format seems to imply that config files are in YAML
[20:48:22] <andrewp> s/imply/explicitly state/ i guess
[20:48:39] <andrewp> But the examples I've seen, eg debian's
[20:48:41] <andrewp> https://github.com/mongodb/mongo/blob/v2.4/debian/mongodb.conf
[20:48:47] <andrewp> are not in yaml as far as I can tell
[20:48:59] <joshua> 2.4 has that format
[20:49:09] <joshua> 2.6 onward I think changed to YAML
[20:49:12] <andrewp> ah but 2.6 onward
[20:49:16] <andrewp> sweet.
[20:49:20] <andrewp> I'll get everyone upgraded
[21:04:59] <daidoji> so I want to run multiple different (filesystem) locations for each of my databases
[21:05:04] <daidoji> how exactly is the canonical way of doing that?
[21:05:19] <daidoji> directoryperdb and 'ln -s'??
[21:05:23] <daidoji> or is there a better way
[21:05:28] <usr> I don't know if thats a good idea
[21:05:34] <usr> a symbolic link can be dangerous
[21:05:52] <usr> Thats how you get format string vulnerabilities and what not
[21:06:01] <daidoji> usr: right
[21:06:09] <daidoji> well its only a local dev machine
[21:06:21] <usr> Well if its only for your own use then it shouldnt be a problem
[21:06:25] <daidoji> so i'm not too worried about security to this particular box
[21:06:33] <usr> But I don't believe thats the canonical way to do it
[21:06:49] <daidoji> what's the kosher method?
[21:06:49] <usr> I don't know the standard way to do it off the top of my head however
[21:06:56] <daidoji> ahhh, I can't seem to find it in the docs
[21:07:06] <daidoji> the above was just the first thing that popped into my head
[21:07:11] <usr> are you mongodb.org
[21:07:16] <usr> on*
[21:07:27] <usr> or the .com
[21:07:34] <daidoji> .org there's a com?
[21:07:42] <usr> yea
[21:07:50] <usr> com is the commercial one, a different set of documenation
[21:07:58] <daidoji> oh really?
[21:08:02] <usr> yep
[21:08:20] <daidoji> do I have access to that or does our company require a license to access that documentation?
[21:08:32] <usr> you have access to it
[21:08:35] <usr> its public
[21:09:07] <daidoji> well I'm on the main site, but can't seem to find the docs
[21:13:08] <usr> hmm maybe i'm mistaken, i thought I was there yesterday
[21:13:48] <usr> nvm
[21:13:53] <usr> http://wiki.mongodb.com
[21:17:13] <daidoji> usr: roger, thanks
[21:18:16] <daidoji> usr: :-( its asking for user/pass
[21:19:55] <daidoji> I think I'll just go with the hard/soft link solution and see if I run into problems
[21:28:52] <insanidade> hi all. How do I search for documents thar are referenced by a document I already know ?
[21:29:58] <insanidade> I mean: if I peform "Transaction.find()" I get one transaction. I have "requests" stored and all of them are related to that transaction. What syntax should I use to get all the requests related to that transaction?
[21:30:48] <insanidade> "Hey, Mongo: I want all requests referenced by that given transaction"
[21:33:50] <daidoji> insanidade: run another query?
[21:35:08] <insanidade> daidoji: right. I executed the first query (in which I get my 'transactioni' object). then, with that object in hands, I would like to search for all the request objects referenced by that 'transaction' object. So, I run a second query but I'm not sure about its syntax
[21:36:01] <insanidade> this is how I insert my transaction: trans = {ipOrig : '10.10.10.10', portOrig : '4300', ipDest : '11.10.10.10', portDest : '80', startTime : '23432542343', endTime : '345455434'}
[21:36:06] <insanidade> and this is how I insert my request: req = {uri : 'http://foohost/app/test/get_values_001.jsp', transaction : trans}
[21:36:34] <daidoji> insanidade: is that stored as the ObjectID that Mongo generates?
[21:36:45] <insanidade> daidoji: yes
[21:36:46] <daidoji> or do you store some other key referencing that transaction object?
[21:37:12] <insanidade> I'm not creating any other key. I'm using the _id generated by mongo
[21:37:23] <daidoji> then grab that ObjectID and search db.req.find({ transaction: trans_object_id } )
[21:37:34] <daidoji> if thats what you stored in the request
[21:39:17] <insanidade> daidoji: I'm referencing the recently inserted object. please look at http://pastebin.com/5N0Y6aeV
[21:39:24] <insanidade> daidoji: that's how I'm inserting data.
[21:40:33] <insanidade> daidoji: I haven't added the 'insert' lines for the reqs but please consider they are there :)
[21:49:28] <daidoji> insanidade: so, I'm not sure what you'd like me to do
[21:50:02] <daidoji> have you read this yet? http://docs.mongodb.org/manual/core/data-modeling-introduction/
[21:50:08] <daidoji> cause you should probably start there
[21:50:48] <daidoji> but basically its like var arr = db.foo.find({blah: blah})
[21:51:31] <daidoji> arr.forEach(function(value){ db.bar.find({ value['_id'] } ) } );
[21:51:33] <insanidade> daidoji: yeah...what I still don't know is how to retrieve a single value in mongo shell.
[21:51:36] <daidoji> get what I'm saying?
[21:51:57] <daidoji> well I mean, how familiar are you with databases and javascript?
[21:52:20] <insanidade> daidoji: not too much about javascript. I'm pretty fine with dbs and modeling.
[21:52:46] <daidoji> well basically db.trans.find() returns a cursor
[21:53:00] <daidoji> iterate through that cursor using javascript or your scripting language of choice
[21:53:23] <daidoji> db.bar.find({ transaction: value['_id'] } )
[21:53:30] <daidoji> for each document in the cursor
[22:05:23] <andrewp> I've a question about changing the mongo service entry on windows. Our mongod service currently uses explicit --dbpath and --logpath flags and I'm moving to a config file setup instead. I'm aware that I can have the dev team run reg update hklm\system\...blabla, but if I just had folks re-run the mongod --install with the updated params, would that also work?