PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Friday the 31st of January, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[02:24:37] <jamiel> Hi all, db.serverStatus() is reporting 65 open connections. Could anyone recommend a way to debug where these are coming from? Currently there is little to no utilisation on my application, although I do have replication enabled to a single secondary node.
[06:19:11] <jp-home> hi there
[06:19:16] <jp-home> anyone still awake?
[06:19:54] <jp-home> http://docs.mongodb.org/manual/reference/operator/update/positional/#up._S_
[06:20:26] <jp-home> can I make a query using more than one attribute of the array elements?
[06:20:38] <jp-home> like on the last example document
[06:20:58] <jp-home> say there are two elements with grade: 80
[06:21:05] <jp-home> but one with mean 75
[06:21:11] <jp-home> and another with mean 85
[06:22:02] <jp-home> can I update the one with mean 85 only like: db.students.update( { _id: 4, "grades.grade": 80, "grades.mean": 85 }, { $set: { "grades.$.std" : 6 } } )
[07:55:15] <mark___> why to use moongoose???
[08:27:52] <akske> hi guys. i am using express with the native mongo driver. i connect via the connect() method. how do i switch to another database after the connection has been established?
[08:44:20] <darius93> mark___: using mongoose would help structure the collections better
[08:55:43] <sinesio> Good morning guys
[08:56:13] <sinesio> Yesterdays Webinar will be available to watch offline?
[08:58:17] <Zelest> *yaaawns*
[08:59:46] <sinesio> i mean, the video/audio, not the slides
[09:03:09] <Nodex> they normaly are on the mongodb website after a few days
[09:05:28] <akske> no one in the mongoDB channel who could tell me how to change the database?
[09:09:23] <mark__> means
[09:09:35] <mark__> whats ur question? may be i know
[09:09:36] <sinesio> what you mean change?
[09:10:15] <ppetermann> akske: i have no idea what express is.
[09:11:42] <sinesio> Nodex: yes but sometimes only the slides are available, and I would like the see the presentation
[09:11:43] <ppetermann> looking at google its some node.js stuff, so i guess the question would be best on some express or node.js channel
[09:12:19] <mark__> Please read the rules of the chat!!!! guys
[09:12:54] <ppetermann> mark__: ?
[09:12:59] <akske> thanks ppetermann
[09:13:45] <mark__> Didnt get who talks to whom>??? and whats the question lolz...i didnt get any log chat also
[09:15:52] <ppetermann> akske: according to google this will help you: http://cwbuecheler.com/web/tutorials/2013/node-express-mongo/
[09:16:26] <ppetermann> mark__: there's no rules on how to make context or to only talk about stuff that you have in your log.
[09:16:27] <akske> funny ppetermann, that'Äs the tutorial that was the source of all evil, i worked through it yesterday :)
[09:16:35] <akske> he's using monk to connect, though
[09:16:43] <akske> that won't fit my needs
[09:16:48] <ppetermann> akske: well in this tutorial you can see
[09:16:51] <ppetermann> var db = monk('localhost:27017/nodetest1');
[09:16:58] <ppetermann> nodetest1 being the db used
[09:17:12] <ppetermann> i mean i'm no node.js dude, but that seems obvious?
[09:17:16] <akske> yup, i know. i just don't wan't to use monk, i'd like to stick to the native driver
[09:17:37] <ppetermann> ah
[09:17:56] <ppetermann> i don't know that native node.js driver either, but i'd assume there is some sort of "use" function
[09:18:24] <akske> thanks for your efforts :) I#ll seek help in some node channel
[09:18:28] <ppetermann> also within connect you can specify what database you want to connect to
[09:18:36] <ppetermann> http://mongodb.github.io/node-mongodb-native/driver-articles/mongoclient.html#the-url-connection-format
[09:21:55] <akske> the problem i have is, i have to connect to the admin database in first place. only if i do so, i can use any other db. however, if i connect via MongoClient::connect(), i'm unable to switch the db afterwards
[09:22:08] <akske> or at least i haven't found a way to do it yet
[09:22:54] <Nodex> what driver are you using?
[09:23:26] <akske> node.js's native mongo driver
[09:26:50] <Nodex> the MongoClient should take care of the connection pooling so it's as simple as defining a server then overwriting the variable
[09:28:38] <Nodex> I'm no node expert but this is what I do
[09:28:39] <Nodex> http://pastebin.com/pKaAzeyc
[09:28:52] <akske> excuse my stupidity, but my head is spinning after all that docu reading. which variable do you mean?
[09:29:07] <akske> ah i see
[09:29:14] <akske> i'll give it a try, thank you!
[09:29:33] <Nodex> the node driver docs are poor in my opinion, they're very confusing
[09:31:59] <akske> they are awful
[09:32:29] <akske> the whole node thing is awful, imo
[09:32:46] <akske> but maybe i just don't get it
[09:33:30] <ppetermann> node.js is horrible, what you expect? :p
[09:34:53] <Nodex> it's not horrible for everything
[09:35:20] <Zelest> it has webscale
[09:37:44] <ppetermann> Nodex: it throws you in the deepest corners of maintenance hell.
[09:38:42] <Nodex> for some things I agree. I has it's place though
[10:01:49] <squeakytoy> hm, isnt possible to mongodump to regular json?
[10:01:53] <squeakytoy> (compared to bson)
[10:07:01] <Nodex> look at mongoexport
[10:09:28] <squeakytoy> thanks
[10:21:29] <remonvv> \o
[10:21:48] <remonvv> Slightly off topic but does anyone know which JIRA workflow jira.mongodb.com uses?
[10:37:28] <tiller> hi
[10:37:56] <tiller> Is there a way to insert some BinData via the console, using its base64 encoding?
[10:39:14] <tiller> I'm not sure BinData(0, "myBase64") does the trick. does it?
[11:19:28] <mark__> how can i write schemas for my app??? using moongoose ,mongodb
[11:20:06] <Nodex> why would you want to take a schemaless / loose schema'd database and tie it down is probably a better question
[11:22:59] <mark__> i want to write schemas using moongoose
[11:23:07] <mark__> for safety
[11:26:08] <Nodex> Safety from what?
[11:30:52] <mark__> i meant safety like validation, guard against missing values, document injection
[11:39:42] <Nodex> is that not what your app is for?
[12:06:42] <tmw> hello
[12:06:51] <tmw> I have a question
[12:07:02] <tmw> i my 'nowa' collection I have this
[12:07:07] <tmw> { "_id" : ObjectId("52eb91c87b0d23b0cb0413c8"), "i" : 0 }
[12:07:08] <tmw> { "_id" : ObjectId("52eb91c87b0d23b0cb0413c9"), "i" : 1 }
[12:07:35] <tmw> but when I type for(i = 0; i < 2; i++) { db.nowa.find({"i" : i}) }
[12:07:44] <tmw> it will only show { "_id" : ObjectId("52eb91c87b0d23b0cb0413c9"), "i" : 1 }
[12:07:59] <tmw> maybe someone will now why is that? :)
[12:08:26] <kali> use print() in the loop around db.nowa.find(...)
[12:08:35] <tmw> yes, it will work I know
[12:08:46] <tmw> but why without it is not working?
[12:10:01] <tmw> the some is with update, it will only update one document
[12:10:06] <tmw> in the for loop
[12:11:35] <Nodex> please PASTEBIN your code
[12:12:21] <tmw> ok
[12:14:05] <tmw> http://pastie.org/8685291
[12:18:38] <tmw> this is also strange http://pastie.org/8685301
[12:18:45] <tmw> or I dont understand something :)
[12:19:56] <kali> nope, not strange
[12:20:13] <kali> first loop, you're putting both documents at i:1, second loop update or or the other
[12:20:20] <kali> one or the other
[12:23:19] <tmw> ah, I got the point :)
[12:23:21] <tmw> thx
[12:24:04] <Nodex> for(var i = 0; i < 2; i++) { db.nowa.find({"i" : i}).limit(1).forEach(function(doc){ printjson(doc);});}
[12:24:06] <Nodex> or that
[12:24:12] <mark__> Anybody ia having the ebook of Mongoose for Application Development
[12:24:31] <tmw> thx
[12:24:42] <tmw> but I still dont get it only only one find result is printed
[12:25:28] <Nodex> because find() returns a cursor
[12:25:37] <Nodex> + which needs iterating
[12:27:23] <tmw> ok but is this not just 2 times run this command?
[12:28:19] <kali> find() does not show you the result. it's the shell itself trying to do something smart with what the javascript expression evaluates too
[12:28:33] <kali> if you do just a find, the shell sees a cursor, and starts iterating over it
[12:28:42] <tmw> a ok
[12:28:48] <tmw> thanks ! :)
[14:22:49] <platzhirsch> On my VPS I noticed super slow queries when starting my application and MongoDB for the first time. 4min for the first 2-3 queries from the app. After that it's fine. Should I fire some warm up queries ?
[14:25:12] <Nodex> it's just loading your working set into ram
[14:25:54] <platzhirsch> Nodex: Which is good and necessary, so I just live with it?
[14:26:24] <Nodex> I dont see why it's a problem, I mean how often do you restart your database?
[14:26:35] <platzhirsch> right
[14:26:58] <platzhirsch> It's just 4min seems to incredibly long, on my local machine it takes 1,6s with a restarted MongoDB instance, but then again no shared I/O, SSD, more CPU priority
[14:27:18] <Nodex> what is your VPS spec?
[14:27:48] <platzhirsch> Nodex: Linode 1024, so 1 GB RAM, 1x Priority on a Xen 8 CPU
[14:28:21] <Nodex> probably why then
[14:31:16] <platzhirsch> Nodex: What do you mean? The low CPU priority?
[14:35:42] <Nodex> that is a tiny instance, no wonder it takes that time to spin up
[14:36:39] <platzhirsch> Okay good… just wanted to learn if I understood what the bottleneck is here :)
[15:04:29] <jp-home> hi guys
[15:04:37] <jp-home> http://docs.mongodb.org/manual/reference/operator/update/positional/#up._S_
[15:04:47] <jp-home> can I make a query using more than one attribute of the array elements?
[15:04:52] <jp-home> like on the last example document
[15:05:26] <jp-home> say there are two elements with grade: 80, but one with mean 75 and another with mean 85
[15:05:37] <jp-home> can I update the one with mean 85 only like: db.students.update( { _id: 4, "grades.grade": 80, "grades.mean": 85 }, { $set: { "grades.$.std" : 6 } } )
[15:06:19] <jp-home> seems when I do that it updates one of them randomly
[15:10:51] <Nodex> you can't do that jp-home
[15:13:43] <Joeskyyy> +1, you'd have to try and script something like that.
[15:33:55] <Ben`> if i have a structure like http://docs.mongodb.org/manual/tutorial/model-tree-structures-with-nested-sets/ what kind of indexes should i make?
[15:34:57] <Nodex> depends how you're going to query it
[15:36:50] <Ben`> i will be querying like in the example, where left is $gt a value, and right is $lt a value
[15:37:46] <Nodex> a compound index on left and right then
[15:38:16] <Ben`> oh ok, thanks
[15:39:45] <Nodex> although I don't understand what the top var part means and secondly they're dotted notation but the inserts are not so I can only assume that's an internal mongodb trick I am not aware of
[15:45:30] <meekohi> If every doc in my collection has a position, are there any pros/cons of using GeoJSON vs. simple [long, lat]?
[15:56:57] <tiller> hey, is it worth-it to put an index on a date? The date is used in a query like "where date > XX"
[15:59:27] <cheeser> very much so
[15:59:36] <cheeser> otherwise you'll do full collection scans
[16:00:05] <tiller> ok good. I wasn't sure if it was "working" on dates
[16:00:08] <tiller> thanks!
[16:20:22] <thiago-br> Hey guys, the use of references can impair the collection?
[16:22:04] <cheeser> ?
[16:24:20] <thiago-br> if I use multiple references, I can lose performance with mongodb?
[16:45:59] <thiago-br> Hey guys, if I use multiple references, the performances of the bank might fall?
[16:47:19] <cheeser> why would it?
[16:48:33] <thiago-br> because they would be simulating relationships.
[16:50:05] <cheeser> mongod doesn't do anything with those references.
[16:50:09] <cheeser> they're just document values
[16:50:45] <Nodex> references are more of a conformaty, they have no real meaning or value
[16:51:17] <Nodex> if your app really needs references then you're either structuring it wrong or Mongodb is not the right fit
[16:54:02] <thiago-br> entendi agora o conceito das referencias. Como estou trabalhando com nodejs + express, eu acreditei que o Mongodb funcionaria para qualquer projeto.
[16:54:09] <thiago-br> Now I understand the concept of references. As I am working with nodejs + express, I believed MongoDB work for any project.
[16:54:24] <cheeser> like any tool, some fits are better than others.
[16:56:40] <thiago-br> You think valid, using MongoDB for an application where each user has access to only your information? Thus each table / collection that would store your user_id.
[17:01:09] <Nodex> thiago-br : I don;t know what that means
[17:14:17] <ekristen> how do people rotate mongodb.log in here?
[17:14:31] <ekristen> the suggested logrotate file seems to make it so that mongodb no longer writes to a log file
[17:53:29] <dada> hello
[17:53:58] <dada> do you guys know if it is a good practice to reduce the size of db option nssize ?
[17:54:24] <dada> basically, we have a lot of small database but mongo allocate a minimum of 16MB
[17:54:49] <dada> and we'd like to reduce it to 1MB - 2MB? any suggestions, folks ?
[17:55:00] <cheeser> did you use the small files option?
[17:55:02] <dada> yes
[17:55:48] <dada> but still, actually, mongo allocate a default 16MB and we are using dotcloud
[17:56:05] <dada> and it seems that it allocates also another 16MB which is unused
[17:56:11] <dada> for prevention
[18:01:16] <dada> any ideas guys ?
[18:02:33] <cheeser> that 16MB file is probaby an extents file
[18:02:44] <cheeser> but i'm not terriblyt familiar with those internals
[18:03:17] <dada> ok :)
[18:03:19] <dada> thanks
[18:55:35] <Kaiju> Hi guys, I just started testing on a new analytics system I built. There is so much data streaming at mongo that it maxed out its one writing core. I think its the index builder that causing the bottle neck on the cpu. I would like to maximize usage on all cores on the server before spinning up more. Is there a best practice for this?
[18:56:13] <Kaiju> or anything else that may be pertinent to high write loads
[19:24:24] <david99world> when I use db.mycollection.getIndexes(), some of the results have a key "ns" with part of this ns being a name in front, so say "products.price", but sometimes it appears to just show "price", what determines if something comes before the word price even if price is in the root of the object? I could understand if the JSON had a nested document, but how is this "ns" created?
[19:26:05] <kali> david99world: weird... ns is usually the "qualified" collection name, that is <database>.<collection>
[19:26:58] <david99world> Ah that's brilliant, thanks
[20:16:09] <Mmike> When I do rs.stepdown()
[20:16:26] <Mmike> there is a chance new primary will be the secondary that was lagged, right?
[20:17:13] <cheeser> possibly
[22:14:26] <saml> db.images.find().sort({uploadDate:-1}) ; db.images.find().sort({modifiedDate:-1}) if I do this often, how do I set up index?
[22:20:36] <Joeskyyy> You're searching through all docs so it won't make a difference.
[22:22:15] <saml> Joeskyyy, what if I do db.images.find({...}) some query?
[22:22:31] <saml> db.images.ensureIndex({uploadDate: -1}) ?
[22:23:30] <Joeskyyy> It depends, are you doing a find on a specific field like uploadDate often?
[22:23:43] <Joeskyyy> You don't want to add indexes unless you're doing searches on that field often.
[22:24:03] <Joeskyyy> Adding indexes add extra space and such on your DB, so you don't wanna just add one because