[00:43:56] <bizzle> In salat, how does one write a query that only returns a subset of the fields in a document
[00:43:59] <goleldar> is it common practice when refrencing another collection by including the collectionId to also include into the document any information you would like available from that referenced collection to avoid making another query
[00:44:10] <bizzle> do you make two different objects?
[00:45:03] <bizzle> like a UserBasic(email: String, username: String), UserDetailed(email.. bio... interests...)
[01:19:25] <fractalid> hey - I have a hanging connection problem w/mongodb 2.2.0. on the server I've got about 3000 connections, 99% of which show as "established" in netstat
[01:19:39] <fractalid> but on the clients, the vast majority of connections show as "fin_wait1"
[01:20:19] <fractalid> on top of that, according to mongodb.log, it's refusing connections because it's hit its max of 6553
[01:22:33] <fractalid> I'll be afk for a bit, sorry - time to go home, I just wanted to get this out there. should be back in half an hour or so
[01:32:24] <retran> wish i had more experience to be able to give meaningful feedback on a schema
[02:17:00] <Bilge> How can you display stats for a given document such as storage space?
[02:57:35] <crudson> Bilge: what other than storage size were you hoping for? Determining the size of an object depends on what language you are using.
[03:38:23] <Init--WithStyle-> Does anyone know how running 6000 consecutive DB inserts into a mongoDB via a javascript driver could be causing the process to consume massive amounts of RAM??
[03:49:37] <Bilge> What? Why would it depend on language
[03:49:51] <Bilge> And I dunno, I just thought there would be some kind of stats thing, but I really just want to know how big documents are
[03:55:58] <Gavilan2> Is there any good "something" on throw and recover arbitrary objects to mongo from javascript (i want to associate the objects with their class once they get back)?
[04:09:29] <crudson> Bilge: you can get a fair amount of stats for server and dbs, but not really at the document level, other than average (b.stats()) and individual size (Object.bsonsize(o))
[04:11:43] <Bilge> In particular I really want to know if storing something as binary is smaller than storing it as a hex string (it should be)
[04:11:48] <Bilge> But I just want to be able to SEE it
[04:12:56] <Bilge> I can't normally because of the weird output format e.g. BinData(2, "BAAAAAA=")
[04:13:12] <Bilge> No idea how much storage it's really taking up
[04:13:15] <crudson> Bilge: as I said, use Object.bsonsize(o) from the shell. Otherwise google "mongodb bson size <some language>" for other languages, as there are different methods.
[07:25:39] <null_route> When performing a moveChunk, it seems as though " the destination shard connects to the config database and updates the chunk location in the cluster metadata" . How does the destination shard know where the config server is?
[08:18:54] <dstorrs> I have a 3 shard cluster (third one just added today).
[08:19:08] <dstorrs> The third one starts and I can connect, but then all commands yield this.
[08:20:26] <dstorrs> I'm Googling around and seeing something about "entire shard down" / "replica set primary unavailable" / "auth information unavailable" but none of those seem to apply.
[08:29:29] <null_route> dstorrs: did you REMOVE any members at any point?
[08:30:23] <dstorrs> yes. This shard was originally added last week and was not having data sent across. we added / removed it a couple of times before we got it working today
[08:31:35] <null_route> My guess: It's related to any annoying property of MongoDB - REMOVING a member causes the PRIMARY to step down and hold elections. When it does this, it closes all TCP connections. This causes the mongos', obviously, to lose connectivity.
[08:32:05] <null_route> they will reconnect, but only after a query to each shard
[08:32:25] <null_route> You're queries should be returning OK after a retry
[08:32:32] <dstorrs> I have stopped / started the mongod and mongos on this machine several times.
[10:12:26] <Azoth> 32-bit builds are limited to around 2GB of data. See here for more information on the 32-bit limitation. from the mongo dowload page
[10:12:32] <algernon> but the reason is probably similar, with the addition that a higher cap would increasingly waste more space.
[10:51:05] <golddog> I can't seem to find any examples for how to best merge duplicate documents in a mongodb collection. I thought i sounded like a job for map reduce but i can't find any examples of map reduce that are not basically just collating statistics
[10:54:29] <golddog> if anyone could point me to any examples of how to do this I'd be eternally grateful
[11:12:03] <kali> golddog: it's not a easy problem, but if you can come out with a signature of your document (some id, or some generated id) you can group your collection counting the occurence of this signature, then look at the counters > 1
[11:19:06] <golddog> kali: every document has an id and I only want to merge the ones with equal id's so identifying the documents are no problem. Basically I have the output of an sql join in a collection and i want to convert from 5 documents with mostly identical properties except for one property to one document with that property as an array as it should be
[11:20:53] <golddog> but I think I'll just remove everything and fix it before i insert it instead for now, just seemed like something one might like to do rather often
[11:21:21] <kali> so what's the problem ? just remove the dups ?
[11:23:42] <golddog> kali: the problem is basically this: I have {id: 1, name: 'foo', tag: 'dog'}, {id: 1, name: 'foo', tag: 'cat'} (in a large scale) and I'd like to merge every document with an identical id into {id: 1, name: 'foo', tag: ['dog', 'cat'] }
[11:28:05] <kali> Goopyo: as a matter of fact, I'm realizing the merging or rewritting you describe falls just into the scope of the aggregation framework
[11:28:29] <kali> Goopyo: not you, the right guy as left
[11:38:15] <Vile> I have documents like {_id: {a:1,t:"2012-01-01T00:00:01Z"}, value:123}, {_id: {a:1,t:"2012-01-01T00:00:51Z"}, value:100}, {_id: {a:1,t:"2012-01-01T00:01:41Z"}, value:0}. I want to build minute averages on it using the fact that value is considered constant until changed
[11:39:17] <NodeX> aggregation framework should be able to perform that
[11:40:57] <Vile> Currently i'm using map/reduce for that, but it is very slow, due to db.coll.findFirst( { t: {$lt:"2012-01-01T00:01:00Z"} )
[13:40:06] <thecodecowboy> Hi. I am considering using MongoDB for this data requirement: http://programmers.stackexchange.com/questions/161602/would-this-data-requirement-suit-a-document-oriented-database. Anyone have any advice on how to structure the data? Would it make sense to allow users to create collections ??
[13:44:40] <ppetermann> thecodecowboy: you know there is a max-amount-of-collections cap?
[13:46:00] <thecodecowboy> ppetermann, baby steps in nosql, interested to learn and wondering if my requirement is a good fit. any thoughts?
[13:46:11] <DiogoTozzi> Does anybody here tested the Full Text Search feature in 2.3?
[13:46:15] <ppetermann> thecodecowboy: http://www.mongodb.org/display/DOCS/Use+Cases you might want to read this one
[13:49:34] <thecodecowboy> ppetermann, yeah, i am looking for the advice of someone with experience of mongodb rather than documentation which will not mention my use case
[13:49:54] <thecodecowboy> ppetermann, but thanks for the link
[13:50:18] <ppetermann> thecodecowboy: well this one is about use cases
[14:02:25] <algernon> ravana: the string is 3 bytes + null + 4 byte length; then there's the field name, 5+1 bytes + length + type; then there's the _id, 3+1 bytes for the name, 1 for the type, 12 for the data, and wrap it in a document (4+1+1 bytes)
[14:02:32] <ravana> my document it has many elements
[14:39:51] <joshua> Thanks. Thats what I thought. I guess they wanted to use more shards so its shared
[14:40:29] <Vile> what's wrong with one server (machine) being arbiter for multiple sets?
[14:46:31] <joshua> Vile I guess functially it doesn't hurt. I might create a second init script with conf so they can be started with a service instead of hacking something into rc.local.
[14:50:52] <timeturne> what is the best way to check the size a particular object will have when added to mongo as a document?
[14:53:22] <timeturne> basically I want to embed the maximum latest blog posts in a "section" document and then push the older ones to another collection
[14:53:30] <timeturne> kind of like a capped subdocument collection
[14:55:39] <timeturne> cool, I'll try that thanks!
[15:13:59] <timeturne> is there an objectid stored for subdocuments for quering purposes?
[15:16:15] <algernon> timeturne: nope, unless you explicitly add it
[15:17:48] <timeturne> would the index be as efficientif I added objectids from subdocuments in it? also, how would I goabout actually adding the objectid to the default _id index?
[15:18:42] <algernon> one for the main document's _id, and another for the subdocuments
[15:27:29] <timeturne> I think I'll implement a character limit on the blog post and just add a fixed number of blog posts rather than checking the size for now
[15:27:47] <timeturne> it would overcomplicate the system before I even launch for the first time
[15:27:55] <timeturne> better to leave that for later
[15:58:44] <bizzle> does a casbah MongoConnection need to be closed?
[15:58:45] <bizzle> it seems that the MongoConnection is actually a connection pool, I am confused
[17:52:18] <FreeFries> hello...I'm running into a problem with mongo shards+replica sets and I'm wondering if there's a way to turn in more debugging information...
[17:52:43] <FreeFries> I have two shards which I want to replicate to three servers, replica set repl_mongod02 works fine
[17:53:09] <FreeFries> replica set repl_mongod01 doesn't work at all failing with a "couldn't connect to new shard socket exception [CONNECT_ERROR] for repl_mongod01/..." error
[17:53:22] <R-66Y> is there a $size for associative arrays that just returns how many keys are in the array?
[17:53:32] <FreeFries> but when I change the "repl_mongod01" to "repl_mongod02" it says that it's not part of the set
[17:53:39] <FreeFries> so it's clearly connecting to *something* at that location
[17:54:06] <FreeFries> when I run mongo to the host and do a rs.status() I get "set" : "repl_mongod01",
[17:54:30] <FreeFries> so I have no idea why it's failing to connect
[17:54:53] <FreeFries> any way to get more information out of mongos, or anyone happen to know how to fix the problem?
[18:02:21] <elux> is there a profiling mode or something in mongodb? (2.2)
[18:02:36] <elux> im finding very simple queries are taking 120ms+ ... they really shouldn't.. and they should be using indexes
[18:02:47] <elux> so perhaps a way of analyzing if indexes are being used properly or whatever
[18:23:44] <kali> peter_c: not a subject for irc, i think... you can find dozen of well argumented blog posts for one side or the argument or the other
[18:23:49] <peter_c> so it wasnt the lack of something
[18:24:00] <Gargoyle> peter_c: Mongo is not a relational db
[18:24:14] <peter_c> yeah its like nosql or something
[18:24:56] <Gargoyle> peter_c: As kali said, there's plenty of resource on the web dig through if you want to bring yourself upto speed.
[18:25:03] <peter_c> yeah i cant understand any of em though
[18:25:16] <Gargoyle> did you start at mongodb.org ?
[18:25:17] <peter_c> im just a project manager and one developer suggested to switch to mongodb for our product
[18:25:29] <peter_c> and another is fighting for scaledb
[18:25:37] <peter_c> im trying to get a third opinion
[18:26:02] <peter_c> yeah i cant understand any of that
[18:26:14] <Gargoyle> peter_c: Seems the first task is to fully research if a document based db fits your product requirements.
[18:27:03] <peter_c> if mongodb is document based, what is mysql based on
[18:28:00] <peter_c> so whats the most cookie cutter example that would draw the scenario where mongodb (document based dbs) would be hands down the better choice versus a rows/tabular
[18:28:48] <FreeFries> how do I reset a replica set?
[18:28:55] <FreeFries> deleting the data directory doesn't seem to do it
[18:29:20] <FreeFries> (by that I mean, how do I clear out all replica config information and start over?)
[18:30:18] <Gargoyle> FreeFries: That normally works. shutdown server, delete (or move) data dir, and start fresh.
[18:30:52] <Gargoyle> But if you have your replica set info in the config / startup param, it will reconnect and resync itself automatically
[18:31:15] <FreeFries> well, my replica set inititally didn't work
[18:31:27] <FreeFries> so now I'm trying to blow away the config and start over
[18:32:59] <FreeFries> but it's giving me various errors
[18:33:17] <FreeFries> the most recent is "all members and seeds must be reachable to initiate set"
[18:34:01] <Gargoyle> FreeFries: Sounds like you are bringing the server back up still telling it to be part of a rs. Do you have it in the config file / startup options?
[18:34:53] <FreeFries> yeah, I want it to still be part of repl_mongod01, but I want to kill the entire thing and start over as if repl_mongod01 never existed
[18:34:58] <FreeFries> do I have to change the name of it?
[18:35:46] <Gargoyle> FreeFries: You will have to take all the servers in the set down together - then I think, initially boot them up without any reference to the RS
[20:13:51] <FreeFries> does anyone happen to know where mongo stores the replicaset config info?
[20:14:13] <FreeFries> I've cleared out the data directory in all of my mongods, along with all of my mongo configs
[20:14:45] <FreeFries> but the replica set config info is still floating around somewhere
[20:15:28] <FreeFries> or would anyone know of some linux tool that would let me find where it's getting the info from? (similar to filemon on windows?)
[20:30:30] <FreeFries> I also can't manually setup the rs config and run rs.reconfig(cfg, force : true)
[20:30:40] <FreeFries> gives an error of "rs.conf() has no properties"
[20:39:20] <FreeFries> maybe I can approach this from another side...how can I see what data is in db.local.system?
[20:39:41] <FreeFries> db.local.system.find() from a mongo console appears to do nothing
[20:39:51] <FreeFries> does that mean it's empty, or the command wasn't run?
[20:50:57] <Gavilan2> So! Is there any "transparent" library or thing to ORM into MongoDB from JavaScript. I'm looking for something that is, taking any app that runs in memory, replace Array or a Collection with CustomCollectionThatGoesIntoMongoDb... And then the app continues working with persistance... Is there anything like that? or do I need to make it?
[20:54:27] <gibletsngravy> Hi, I'm learning how to use the Mongo's profiling feature. When I query the system.profiles collection, why isn't the inserted data shown for "insert" operations (as updateobj is shown for update ops)?
[20:56:07] <Venom_X> Gavilan2: I'm aware of mongoose.js and mongoskin.js, both node.js packages
[21:43:26] <Neptu> The nodes passed to Connection() are called the seeds. As long as at least one of the seeds is online, the driver will be able to “discover” all of the nodes in the set and make a connection to the current primary