PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Monday the 22nd of December, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[01:24:24] <agenteo> hi, any hint on why running explain on an aggregate doesn’t show nScannedObjects?
[02:05:38] <Techdeck> hey all, I have a few stupid questions. I'm just looking into mongodb and I'm trying to understand a few things. 1) Do I need to specify the _id of every item or will mongodb do it for me if I don't specify it? 2) Will searching by id rather than a key inside a document be faster? 3) I'm thinking of integrating with Spring, should I use spring repositories?
[02:08:15] <joannac> Techdeck: 1. the server will generate an _id for you if you don't specify it. 2. there is an index on _id by default, you can create other indexes on other fields if you want to search on those
[02:13:19] <Techdeck> joannac, I see, so they're not indexed by default I take it. Do you use java/spring by any chance?
[02:14:11] <Techdeck> I'm wondering if there's a utility or a class that scans your classes for mongodb annotations and creates the 'DDLs' for you
[02:18:15] <cheeser> you don't need DDLs with mongo
[02:19:17] <Techdeck> I meant create indexes and such also
[02:19:40] <Techdeck> so I'll add for instance @Index annotation to my class properties and have something that will generate it for mongo so I can run it
[02:21:57] <bmillham> Just use ensureIndex if you want a field indexed.
[02:22:28] <bmillham> Or if using mongoengine, add the index to the document class.
[02:24:39] <Techdeck> thanks bmillham, I'll look into java + spring implementation of that
[02:25:33] <bmillham> Techdeck: it will take some getting used to (I'm still learning myself), but the best advice I can give you is to FORGET everything you know about databases.
[02:25:36] <Techdeck> though I'd rather create it once and then forget about it. Maybe I'll create my own utility
[02:25:48] <Techdeck> hehe, trying :D
[02:26:07] <Techdeck> my next question would be how do you 'join' documents, and is it good practice?
[02:26:51] <bmillham> Depends on why you are doing the joins. Embedded documents work great, so you don't need 'joins'
[02:27:51] <bmillham> My current project is a bit of a hybred, some embedded documents, some relative documents
[02:29:20] <Techdeck> not sure what embedded doucments are, lemme read about it a little bit
[02:29:24] <bmillham> My project is still evolving. But here is what seems to be working for me. If you have an old style table that only relates to another table, then embedded document is the way to go
[02:31:12] <Techdeck> do you use java?
[02:32:11] <bmillham> In my current project, I had an SQL statement that never run in a reasonable amount of time (1+ minutes). With my current mongo version of the db, the same query takes 300ms to run ;-)
[02:32:24] <bmillham> No, not a java user. I'm using python.
[02:32:31] <Techdeck> wow
[02:32:38] <Techdeck> impressive.
[02:33:06] <bmillham> It was select within joins within selects.
[02:33:49] <bmillham> But I designed the mongodb with those types of queries in mind.
[02:33:59] <Techdeck> ok, I see what embedded documents are now. Sweet. So if I have a 'User' document for instance, and that object has a list of 'Track' objects, I will be able to search on user's tracks quickly?
[02:34:05] <bmillham> With Embedded Documents (hint, hint)
[02:34:50] <bmillham> Yep
[02:35:04] <bmillham> And you can index on the embedded documents
[02:35:28] <Techdeck> awesome! is it good practice to also keep for instance a userId inside the 'Track' object
[02:35:29] <Techdeck> ?
[02:35:50] <bmillham> That's what I'm still in progress of learning
[02:36:16] <bmillham> Where embedded documents are better that related documents
[02:36:30] <bmillham> I'm still playing with that.
[02:37:25] <bmillham> Related Documents are more like SQL joins
[02:37:30] <Techdeck> what I suggested == related document?
[02:38:02] <bmillham> But more expensive in roundtrips to the database.
[02:38:18] <Techdeck> true
[02:39:37] <bmillham> I have a python script that creates a version of my mongodb database, so I can easily make changed to the schema and create a new version of the mongo database.
[02:39:59] <bmillham> So I'm still experimenting with finding out the best schema.
[02:40:39] <Techdeck> ah, that's exactly what I need for java. I guess I can create it myself with some work
[02:43:18] <bmillham> Writing your own conversion script will help you learn how mongo works (at least it did for me)
[02:44:52] <Techdeck> the real problem I have is that I don't actually need to use mongodb for anything, I'm just trying to learn it for fun. At work we use Oracle. I need to find a use for it so I can really learn it :P
[02:44:56] <bmillham> And makes it easy to try different schemas
[02:46:14] <bmillham> I'm kinda doing the same thing, but as I've gotten more into this, I'm planning on making mongo my main database.
[02:48:24] <Techdeck> did you try anything else?
[02:48:31] <bmillham> MongoDB has done away will all sorts of insane JOINS that I had to do. Because I designed the schema with those JOINS in mind
[02:49:00] <bmillham> As in NoSQL databases, No.
[02:51:37] <Techdeck> do you search by id at all?
[02:51:46] <Techdeck> probably only when it's not generated, right?
[02:53:06] <bmillham> Yes, I use searching by id, but I also (at least for now) have an old_id (indexed) field that I can use to search by the original mysql field
[02:53:45] <bmillham> But I also have searching by text, and that works great! (think fuzzy search)
[04:44:53] <kakashiAL> hey guys, I am using mongoose and everything is working so far, but I tried to have an array of array as a defalt value, something like [ ["test", 3, false ] ]
[04:45:07] <kakashiAL> but what I get is an array with 3 elements
[04:45:11] <kakashiAL> please help
[07:55:33] <JB6> Does multiple pipelines in an aggregate effects query performance
[08:25:37] <amitprakash> Hi, I have a document with multiple sub-documents.. Given that I'd like to run queries for reporting that would have filters or map reduce against a lot of keys against the subdocuments, what would be a good way to go about it?
[08:26:04] <amitprakash> Would you recommend something like hbase/hadoop or is mongodb ideal for this purpose by itself
[09:32:57] <newbsduser> hello, if i increase mongodb instance count on a single machine, does it affect write performance... more instance means that more write?
[09:35:34] <newbsduser> for instance: iam using 24 instance on a single box
[12:00:42] <borjagvo> Hi all, I've posted on Stackoverflow: http://stackoverflow.com/questions/27601406/full-text-search-taking-too-long. Does anyone have an answer to it? Thanks!
[12:05:12] <d-snp> borjagvo: did you try explaining the queries?
[12:05:25] <d-snp> such slow times make it seem like the data doesn't fit in ram perhaps
[12:06:43] <d-snp> you can get all kinds of metrics out of mongo
[12:06:57] <d-snp> check if there's many page faults, check the storagesizes
[12:07:06] <borjagvo> d-snp: nop. What should I add in order to get them? What command should I execute?
[12:07:36] <cheeser> at a minimum, you should run an explain
[12:07:41] <d-snp> mongodjust add .explain() after your query
[12:07:50] <d-snp> when executing it from the shell
[12:10:13] <d-snp> hey cheeser, could I execute a command like sh.shardCollection() from the ruby driver somehow, or are commands like that only available from the shell?
[12:10:26] <borjagvo> d-snp: thanks. I'll do it and update SO question.
[12:17:57] <cheeser> d-snp: i don't know that much about the ruby driver.
[12:18:13] <cheeser> the java driver exposes certain commands at least. i'm sure the ruby driver does the same.
[12:21:29] <d-snp> hmm, nothing related to sharding though
[12:21:41] <d-snp> perhaps it's just not implemented
[12:26:34] <theForce> hi folks
[12:26:52] <theForce> how can i decode a json string in a mongodb script?
[12:30:05] <chetandhembre> ok which ec2 instance you people use for config server in sharing ?
[12:30:10] <chetandhembre> *sharding
[12:38:06] <borjagvo> where can I find an explanation of all fields in explain.stats? It is not explained in http://docs.mongodb.org/manual/reference/method/cursor.explain/
[14:34:58] <chetandhembre> Can i add currently replica set to sharing cluster ?
[14:36:41] <chetandhembre> My replica set already has about 100 gb of data ?
[14:36:52] <chetandhembre> any one want to help here ?
[15:03:54] <borjagvo> Hi, I've updated http://stackoverflow.com/questions/27601406/full-text-search-taking-too-long. There is lot of info now on each of the queries...
[16:21:03] <Tug> Hi, I have deployed a mongodb cluster using automation agents in mms, it's working great. Now I am thinking about deploying my mongos with my front app servers using my own service orchestration tools. Can I do that? what will happen if I edit the cluster in mms ?
[16:31:47] <jiffe> is there a way to detect problems in config servers?
[19:39:13] <r01010010> hi everyone
[19:43:09] <r01010010> this: this.findOne({ _id : { $eq: mongoose.Types.ObjectId('54986a8b43db661a0ec827e4') } }).exec(cb)
[19:43:25] <r01010010> throws me an error that says : Can't use $eq with ObjectId
[19:43:30] <r01010010> i'm stack!
[19:49:39] <r01010010> well, here is the stackoverflow question http://stackoverflow.com/questions/27609414/simple-query-by-id-with-mongoose-and-node-js-not-working
[19:52:30] <harttho> why not _id : mongoose.Types.ObjectId('54986a8b43db661a0ec827e4')
[20:01:28] <r01010010> harttho sorry its solved
[20:31:29] <jmdcal> hi all, where can i find the source of mongodump in the latest git
[20:35:58] <cheeser> jmdcal: https://github.com/mongodb/mongo-tools
[20:44:48] <jmdcal> cheeser, thanks, the docs are out of date in the git repo
[20:44:52] <jmdcal> you want a ticket for that?
[20:46:39] <jmdcal> https://jira.mongodb.org/browse/SERVER-16637
[20:49:58] <cheeser> good call. thanks.
[21:16:13] <jmdcal> np
[21:29:45] <adrian_lc> hi, is there a "sort of okay" way to deploy mongo without so many machines?
[21:30:05] <adrian_lc> we'll be using it as a buffer only for now
[21:33:02] <cheeser> huh?
[21:52:30] <jiffe> BSONObj size: 27840613 (0x65D0A801) is invalid. Size must be between 0 and 16793600(16MB)
[21:52:52] <jiffe> I'm getting this when I try to sh.shardCollection on an existing collection, any idea why?