PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Wednesday the 21st of November, 2012

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[02:01:08] <addisonj> so... doing an rs.status, I am seeing a secondary with an optime ahead of my primary... does that point to something wrong?
[02:02:13] <addisonj> ah, nm, just realized I am doing it from a secondary, so that probably lags
[02:08:24] <_m> lol
[02:18:06] <palanglung> how to enable oplog on development machine i need to develop / test storm on my development machine
[04:35:24] <xaq> Hey guys, anyone have opinions on the best mongodb cloud hosts? Are mongolab and mongohq good solutions?
[04:38:04] <mdedetrich> xaq: I use mongohq and havn't had any issues with them
[04:38:34] <xaq> The speed and reliability are up to expectations?
[04:45:35] <mdedetrich> xaq: yup, but the handiest thing about mongohq is its online database and management
[04:45:56] <mdedetrich> does anyone know if there is a zip like method when doing findAndModify with a $in
[05:06:57] <fotoflo> some quick questions: 1) when i do a db.x.find() how do i return only, for example, the title of the document I find?
[05:08:47] <fotoflo> err got it :-)
[06:51:18] <noobie25> i can't seem to wrap my head around this: if i have a collection called: "comments" and in comments, i embed ObjectId's for a items in my User's collection ... how do i query Comments such that the User Obect Id's are already expanded?
[06:51:51] <noobie25> it seems, i have to do multiple queries on the User's ObjectId's ... which i don't want.
[06:57:28] <crudson> noobie25: correct. Or use a framework that will understand references between documents (mongomapper et. al.). This leads to another question, do you always want to expand Users, or at the time when you need that information? (see lazy loading)
[06:58:49] <noobie25> crudson: i'm in a situation, where i always need to expand the user. for example, if a user has decided to change his profile picture, i'd like this change to be available.
[07:01:58] <noobie25> crudson: maybe there is a different way to model I haven't seen yet? Basically, ... i have multiple posts (being shown) and would like to load their comments along with user id .. without requiring N*M queries (N comment * M Users per comment)
[07:03:30] <crudson> noobie25: you can't ask for documents to be dereferenced in a single query. For your options see http://docs.mongodb.org/manual/applications/database-references/
[07:04:33] <crudson> noobie25: it could be a data modeling issue, or a caching one for instance
[07:05:03] <crudson> noobie25: retrieving someone's avatar could be helped by the latter for example
[07:05:47] <noobie25> crudson: how would you model say a Post, Comment, and User? I would like to show multiple Posts on a page.
[07:06:01] <noobie25> crudson: thx for you help by the way. thought it was quiet in here.
[07:10:55] <crudson> noobie25: no probs. It seems sensible to me to embed comments within posts but keep users separate.
[07:13:56] <noobie25> crudson: thx for helping out. i'm looking into mongomapper right now.
[07:14:04] <crudson> noobie25: and pay careful attention to not return comments when you don't need them, and only the subsets of comments as you wish. http://www.mongodb.org/display/DOCS/Retrieving+a+Subset+of+Fields
[07:14:45] <crudson> nothing helps you learn it better than doing it manually on a small scale to start with :)
[07:54:08] <stennie> http://www.10gen.com/careers/positions/manager-software-engineer-in-test !
[08:35:54] <[AD]Turbo> hola
[08:37:18] <ilyak> hiya *
[08:37:31] <ilyak> How do I figure out the size of the record in mongodb?
[08:37:38] <ilyak> relative to the limit of 16000000
[08:37:58] <ilyak> and how do I find the biggest records in a collection?
[09:20:27] <gmg85> hi guys?
[09:20:35] <diegoviola> hi
[09:20:41] <gmg85> i have a couple of questions regarding mongodb
[09:21:07] <diegoviola> just ask, i'm a newb though, i'm sure many people here can help you
[09:21:23] <diegoviola> :)
[09:21:58] <diegoviola> or at least i hope so
[09:22:00] <gmg85> cool
[09:22:00] <lqez> ... and someone will toss a url of SO to you.
[09:22:15] <lqez> :]
[09:22:19] <gmg85> mdoes mongo db maintain data and indexes in RAM?
[09:22:39] <lqez> they just store data/indexes with memory-mapped-file
[09:22:48] <lqez> so, it's up to kernel.
[09:22:57] <lqez> AFAIK
[09:22:58] <gmg85> for quick fetches or is it an on
[09:23:17] <gmg85> cool
[09:23:39] <ilyak> hiya *
[09:23:42] <ilyak> How do I figure out the size of the record in mongodb?
[09:23:42] <gmg85> and what happens should the system be rebooted?
[09:23:45] <ilyak> relative to the limit of 16000000
[09:23:48] <ilyak> and how do I find the biggest records in a collection?
[09:24:36] <gmg85> does mongo db repopulate ram with some of my data upon system reboot?
[09:24:48] <lqez> ilyak: what's the meaning of 'biggest'?
[09:25:16] <lqez> gmg85: it needs warming-up time. every data are in disk.
[09:26:52] <lqez> gmg85: ref- http://www.mongodb.org/display/DOCS/Caching
[09:27:15] <gmg85> so it fetches data from disk when there is a miss in RAM?
[09:27:24] <lqez> gmg85: similar.
[09:27:47] <yud1z_> hey everybody
[09:27:52] <lqez> but I didn't examine the source code of monogodb. I'm just a user.
[09:28:00] <yud1z_> i problem here
[09:28:11] <yud1z_> i have array http://pastebin.com/i5ZUQNm6
[09:28:39] <yud1z_> how i filter [type] => activity
[09:29:20] <Gargoyle> yud1z_: {'stream.type': 'activity'}
[09:30:22] <gmg85> lqez: thanks..let me take a look
[09:30:45] <Gargoyle> yud1z_: If you want just the 'activity' entries from the sub arary, then that is down to you to do in the code
[09:31:24] <yud1z_> so, load all first, after that filter from code?
[09:31:50] <Gargoyle> yup
[09:33:01] <Gargoyle> yud1z_: Alternatively, you could store your stream entries in a separate collection. Obviously depends on what works best for your schema
[09:33:52] <yud1z_> so, that is not the rich document?
[09:34:52] <Gargoyle> That's one way of putting it - but there's obviously a balance to be made between fully rich docs, and the performance of doing that kind of processing.
[09:36:26] <Gargoyle> We have batch jobs that take 45 mins and gobble 2gb of ram. but that fits in with our needs!
[09:36:48] <yud1z_> oh .okey, so and if i separate coleection of stream, what if i make document inside it, for example i make for comments. i separate again?
[09:37:11] <Gargoyle> yud1z_: That's up to you!
[09:37:28] <yud1z_> oww. okey
[09:37:30] <Gargoyle> yud1z_: Depends on how you are going to access and process those comments.
[09:37:52] <ilyak> lqez: I mean the record that is closest to being rejected on insert as being too big
[09:38:08] <ilyak> considering the built-in mongo limit of 16 million bytes per record
[09:38:21] <ilyak> I don't know how it is calculated but wanna figure it out
[09:38:39] <yud1z_> yeah. you are right
[09:39:37] <gmg85> does mongo db have an eviction scheme for when you have more data than can be held in RAM in the memory mapped files?
[09:39:48] <lqez> ilyak: mongo convert JSON object into BSON , as you know.
[09:39:58] <lqez> and the 16MB limitation is about BSON size.
[09:39:59] <lqez> http://www.mongodb.org/display/DOCS/Documents
[09:40:52] <lqez> yud1z_: you can calculate the size of BSON with http://bsonspec.org/#/implementation
[09:42:13] <yud1z_> yeah, i just thinking, how the model is, separate, and make it scalable
[09:43:13] <lqez> I think mongo does not separate an object into pieces.
[09:44:06] <kali> ilyak: you cal also generate a few typical documents with your favourite language and use the bson library to generate the binary version and check it out
[09:49:28] <yud1z_> okey, guys thanks alot.
[10:06:32] <gmg85> http://blog.engineering.kiip.me/post/20988881092/a-year-with-mongodb
[10:06:52] <gmg85> does anyone agree with the cons given in that blog?
[10:09:46] <ilyak> kali: But how do I figure out BSON size of objects inside mongo?
[10:09:57] <ilyak> To see if I ever get close
[10:13:19] <kali> ilyak: look at the driver classes, the one responsible for transforming BSONObject into binary data should be quite easy to spot
[10:13:32] <kali> ilyak: BSON.encode in the java driver for instance
[10:55:03] <chutsu> Hello, I'm having problems with "Error: getMore: cursor didn't exist on server, possible restart or timeout? src/mongo/shell/query.js:113"
[10:55:18] <chutsu> I was perfroming an update over all documents
[10:55:31] <chutsu> the command was simply
[10:55:45] <chutsu> db.collection.find().forEach(function(doc) {
[10:56:02] <chutsu> if (counter > 2) { counter = 1;}
[10:56:48] <chutsu> db.collection.update({"_id", doc._id}, { "$set" : { "group" : counter }});
[10:56:53] <chutsu> counter += 1;
[10:56:56] <chutsu> });
[11:03:35] <ilyak> kali: So I can't do it in mongo console?
[11:04:18] <chutsu> sorry ilyak I missed your question, what was it?
[11:04:51] <ilyak> chutsu: Is it possible to approximate BSON size of a record in mongo console?
[11:05:37] <chutsu> well you can find out how many records there are using
[11:05:48] <chutsu> db.collection.find().count()
[11:05:59] <chutsu> use `show dbs`
[11:06:03] <wereHamster> db.collection.count()
[11:06:21] <chutsu> and work out how big each document is
[11:06:28] <chutsu> in average
[11:06:50] <chutsu> Or are you seeking size of a particular record?
[11:18:08] <Kilian]> Hi
[11:18:42] <Kilian]> i have some bson files, how can i open them, is there any kind of viewer tool available for linux ?
[11:32:06] <chutsu> Kilian
[11:32:09] <chutsu> it depends
[11:32:23] <chutsu> If the data is JSON just find it!
[11:33:58] <Derick> Kilian]: PHP atleast has a function to deserialize BSON into arrays - I am sure other language's drivers might have that too
[11:34:36] <Kilian]> i used mongodump now
[11:35:23] <Derick> Kilian]: http://php.net/manual/en/function.bson-decode.php - http://mongodb.github.com/node-mongodb-native/api-bson-generated/bson.html#deserialize
[11:35:31] <Derick> mongodump just dumps a database to BSON...
[11:36:32] <Kilian]> Derick: http://docs.mongodb.org/manual/reference/bsondump/#usage
[11:37:35] <Derick> yes, that's not mongodump, but bsondump - two different things :-)
[11:38:15] <Kilian]> typo ^^
[11:39:07] <Derick> it made it mean something else ;-)
[11:39:35] <ilyak> chutsu: Yes, I'm seeking size of a particular record
[11:39:46] <ilyak> I want to figure out how big are largest ones are
[11:45:59] <ilyak> Now I have one big bson dump
[11:46:11] <ilyak> one bson per collection
[11:46:25] <ilyak> is it possible to split it into individual records somehow?
[11:47:11] <chutsu> ilyak found a script for you to find the largest BSON
[11:47:25] <chutsu> https://groups.google.com/forum/?fromgroups=#!topic/mongodb-user/wVMLQqRDL70
[11:47:37] <chutsu> post number 3
[11:47:49] <chutsu> by Scott Hernadaz
[11:50:09] <ilyak> chutsu: Thank you very much!
[11:50:30] <chutsu> no probs, glad to help
[11:51:40] <ilyak> so far the biggest object is 2761944
[11:51:56] <ilyak> not much to worry
[11:52:17] <ilyak> less than one fifth
[12:06:27] <pratz> Hello guys
[12:06:33] <Zelest> o/
[12:06:34] <pratz> I am new to mongodb
[12:06:44] <Zelest> welcome to pure awesomeness! :D
[12:06:52] <pratz> I just created a new document with django
[12:07:02] <pratz> django and mongodb are connected
[12:07:15] <pratz> I can see it with mongo interpreter
[12:08:03] <pratz> When I fetch documents through django, it gives me records , but when using mongo interpreter, I can not see any thing
[12:08:21] <pratz> I can only see database name when I do 'show dbs'
[12:08:40] <pratz> but when i do db.mongotest.find() - it does not return any thing
[12:09:04] <pratz> if I fetch from django I get all the documents
[12:09:28] <pratz> I think I have missed something, as documents are saved, but I can not see them with mongo interperter
[12:09:36] <pratz> anyone guys ?
[12:12:19] <pratz> hold on
[12:12:34] <pratz> I am sorry guys , I was accessing it in wrong way
[12:42:49] <Mmike> can I increase maxconn in mongodb without restart?
[13:14:46] <mischat> hello people /me is new to mongo. And I have a question about the find syyntax
[13:15:12] <mischat> I can do what are in essence "select *" queries
[13:15:36] <mischat> but i was wondering whether there is a way to "select foo,bar from " instead of "select * from"'ing ?
[13:15:56] <mischat> sorry to use SQL syntax, but I thought that would be the easiest way for me to get the question out.
[13:15:57] <Derick> yes, that is called a projection
[13:16:02] <mischat> ah cool
[13:16:04] <mischat> thanks
[13:16:06] <mischat> i will google that now
[13:16:12] <Derick> find() has that as second argument
[13:16:16] <Derick> (on the shell)
[13:16:27] <mischat> sweet : http://www.mongodb.org/display/DOCS/Retrieving+a+Subset+of+Fields
[13:16:34] <Derick> yup
[13:16:37] <mischat> thanks Derick
[13:20:35] <mischat> ah yes, so I saw mention of the project where "find ( {bar : {$gt > n}, {"foo : 0"} ) online, but the ability to have a "1" in the projection is what I was looking for.
[13:20:36] <mischat> cheers
[13:23:27] <Mmike> mischat, i recommend course on 10gen site
[13:23:34] <Mmike> it's a bit slow, but otherwise excellent
[13:24:04] <mischat> Mmike: i will have a look now :)