[02:34:45] <personal> Hey guys, I was wondering if anyone here could potentially help me find an alternative for a SQL query -- I have no clue how to do this on Mongo.
[03:04:31] <mattbillenstein1> personal: I'll bite, what is the query?
[04:01:09] <richardraseley> Just to clarify my understanding on Mongo - a collection contains one or more documents and those documents contain key, value pairs called "field" and "value" respectively?
[04:01:34] <richardraseley> There isn't a key value pair within a field - that wouldn't make sense.
[04:06:45] <richardraseley> mrpro: I am trying to visualize what you are saying. If I were storing a list of employees - name : john smith, address : 123 any street, etc.
[04:07:14] <richardraseley> If the key is "name" and the value is "john smith" - where does the "element" come into play?
[04:07:46] <richardraseley> mrpro: Or are you just talking more generally about an element of an array?
[04:16:37] <stefancrs> advorak: won't that overwrite the entire documents?
[04:17:35] <advorak> stefancrs, upset will create a document if the matching criteria """Upsert means "update the document if present; insert (a single document) if missing"."""
[04:21:23] <advorak> will update the vehicles collection matching the category Cars and set the discount field in the result to be 0.25 (multi is true)
[04:23:26] <advorak> stefancrs, are you wanting it to update if the field merely if it EXISTS in a document? or do you want to update it if the value of x is true?
[04:24:02] <stefancrs> advorak: the field exists in all documents in the collection. I want to set its value to 0 on all documents.
[04:24:16] <stefancrs> advorak: so "no criteria" so to speak
[05:29:24] <omid8bimo> im trying to run repair on my database but i get this error: "errmsg" : "clone failed for kookoja with error: query failed kookoja.system.namespaces"
[05:29:40] <omid8bimo> any ideas why? (this server is secondary in a replicaSet)
[06:39:20] <omid8bimo> im trying to run repair on my database but i get this error: "errmsg" : "clone failed for kookoja with error: query failed kookoja.system.namespaces"
[06:39:24] <omid8bimo> any ideas why? (this server is secondary in a replicaSet)
[08:21:08] <skot> Guest42665: you should not call —repair without a good reason. It will be time consuming to copy all the database files and rebuild the indexes.
[09:29:07] <gigo1980> hi all, i make an remove shard… now i have in my status "draining": true
[09:29:22] <gigo1980> how long does this take… the shard was only 400 MB
[09:30:00] <gigo1980> and is there an option to move non sharded collections databases ?
[09:59:48] <guest_34672> Hello. I have a question regarding the java driver. I have a class "MyClass" that extends BasicDBObject. If I call "(MyClass) collection.find().limit(1).next()" everything works fine. It is correctly casted to MyClass. Now I want to use findAndRemove. When I call "(MyClass)collection.findAndRemove(new BasicDBObject())" i get the following Exception: java.lang.ClassCastException: com.mongodb.BasicDBObject cannot be cast to org.example
[10:01:32] <skot> yeah, that doesn't work with commands
[10:14:37] <gigo1980> is it posiblem that i can set an disk limit for an database ? inside mongodb
[10:15:14] <skot> not really, there is a thing called quotaFiles which limit the number of files create for any database (each database)
[10:17:15] <gigo1980> at the moment i have in my shard and also replication the following naming convention "mongo01" mongo02… now i will set the full quallified domain name for the nodes, how can i do this on production ?
[10:18:40] <gigo1980> can i configure "smallfile" in my mongoconfiguration ?
[11:32:29] <omid8bimo> im trying to run repair on my database but i get this error: "errmsg" : "clone failed for kookoja with error: query failed kookoja.system.namespaces"
[11:32:33] <omid8bimo> any ideas why? (this server is secondary in a replicaSet)
[13:05:03] <Progster> I don't understand. I'm connecting to my db using my user name and password, and yet when I execute show dbs I get a message same listDatabases failed, "need to login"
[13:49:31] <skot> no, it only has 1-3 files at a time and roll over as new ones are created and deleted.
[13:49:39] <dcrosta> infinitiguy: the journal files are rotated as they age out. in general you'll have 3 or 4 gigs of journal files, but possibly a bit more under heavy write load
[13:50:56] <infinitiguy> what's the max age of a journal?
[13:51:04] <infinitiguy> I guess - when do they age out?
[13:51:31] <infinitiguy> it's the "possibly a bit more" I'm interested in under heavy load
[13:54:15] <dcrosta> infinitiguy: I'd have to check the code to be exactly sure, but I believe the case is when lots of data is written between main data file flushes. journal files will be kept around until all the data they represent has been flushed to the main files.
[13:54:47] <infinitiguy> one more question: what is the order that a sharded environment should be started? config server - mongos router - mongo databases?
[13:55:00] <infinitiguy> or does it not matter much and they'll converge once everything is online eventually?
[13:58:19] <infinitiguy> actually - one more after that - is there a way to see how much whitespace is allocated compared to actual data within a database? Our mongo has about 6.5-7GB of DB files allocated but looking in the collections it only says about 1.5gb of data
[14:12:58] <infinitiguy> is capped collection number of records?
[14:16:11] <infinitiguy> there's 50 2gb files on disk
[14:16:45] <remonvv> Yes but a) How did you conclude your data should actually take 20gb of space and b) why do you think the 100Gb reserved for data files is wrong?
[14:17:02] <dcrosta> infinitiguy: could be other databases (the "local" databse can be large if you have a lot of free space and are using replica sets), or other collections in your "main" database
[14:18:20] <infinitiguy> i guess those are good questions - I'm not familiar with how this environment was setup - just throwing a question from over the wall here in the office
[14:18:30] <remonvv> If you want to store X bytes of data in MongoDB it will not result in X bytes of disk space used. Every document includes all field names as well so that alone may double or triple space used. Then there's things like index files, oplog, journaling, preallocation of data files, padding, etc.
[14:21:34] <infinitiguy> the only difference was today I initially tried to start it using an init script (copied and changed from the default mongo init) and I got that error so I tried my old way.
[14:21:38] <infinitiguy> nope - let me double check the log
[14:22:45] <remonvv> Do that. Also check if you mongos is up or not.
[14:27:41] <infinitiguy> it will be one of these days
[14:28:04] <remonvv> rydgel, then do it on that shard :) it's usually better to just do it through mongos though. It's pretty quick if you have journaling enabled.
[14:29:45] <remonvv> rydgel, shards don't know they're part of a sharded setup so all operations that do not affect cluster topology in some way can be invoked on a local shard.
[14:31:58] <rydgel> remonvv: ok I see. In fact I’ve got a problem because my chunks do not move anymore. I've got a chunk which is somewhat unmovable and mongos try to move it forever
[14:32:32] <rydgel> remonvv: so I guess something is broken on the source shard, that's why I'm trying to repair it
[14:39:14] <spillere> when I create a new user, i run this query http://pastie.org/4114789
[14:39:41] <spillere> to add another photo, would I add an update,save? how would be the new query to add a new item to photos?
[14:47:28] <remonvv> rydgel, what's the exact error?
[15:05:18] <rydgel> remonvv: ok, here is the log from the error I got. Very strange I don’t understand. http://pastebin.com/1YXSmkGF
[15:06:02] <remonvv> rydgel, your data is corrupt.
[15:06:50] <remonvv> rydgel, your data header is malformed. Repair is your only possible route but might fail. Alternative is to find the broken object and delete it.
[15:12:53] <rydgel> remonvv: did you have any hint on how I can find this object?
[15:14:32] <rydgel> remonvv: there is a mention of ObjectId('4f49803dbf30e2a54f000100') but I cant find it with find()
[15:18:49] <Scyllinice> What's the right way to create a unique index on embedded documents? I want a user to have only unique "likes" (category_name, and name) but I want other users to be able to like the same things. So I want the unique index to apply only within the context of the user itself, not the entire user collection. I'm not sure how to go about it.
[15:22:23] <skot> I think you want to only add it the user doesn't already have it.
[15:22:43] <skot> make the query such the if the user has it already it doesn't return any docs for the update
[15:23:10] <skot> If you provide a sample doc in gist/pastebin/etc I can help you fashion the query.
[15:28:08] <Scyllinice> skot: Scrubbed it to contain only the bits I important: https://gist.github.com/34c8b054b3bbd3c2a3dd
[16:23:30] <Goopyo> Q: I want to write a ranking algorithm that calculates P/L on trades for all users/trades. If I have say 50,000 trades and new trades come in regularly and I want read all 50,000 documents to python process them. I have 2 ways of doing this:
[16:23:49] <Goopyo> 1. Read all necessary since last read to memcache, process from there
[16:24:11] <Goopyo> 2. Perform full 50,000 document read and run calculations
[16:24:30] <Goopyo> the rankings are updated every 5 minutes. Would 2 be to heavy for the database?
[16:46:42] <Goopyo> Guest42665: yeah doing that now.
[17:16:21] <richardraseley> So, is Mongo's query language officially called anything (e.g. Mongo Query Language, MQL) or is that just what people refer to it as?
[19:17:13] <Progster> I'm using mongo as a lookup for a set of values (i.e. distinct). It seems wasteful to create an objectid for each item since each item is already guaranteed to be unique. But when I try to set the ObjectId to my string, I get a mesage saying, "Illegal ObjectId format". Is what I'm doing a bad idea in general? Or am I just misunderstanding something about ObjectIds?
[19:17:56] <doug> import/export are handled by separate binaries, not part of the mongo API, right?
[19:18:07] <Progster> doug: yeah, mongoimport and mongoexport
[19:18:09] <doug> i'd like to avoid having to call the binaries if i could
[19:18:20] <doug> so i don't have to worry about those dependencies when porting this stuff to a new architecture
[19:28:36] <stymo> when doing an upsert, is there a way to tell if you did an insert or update?
[19:28:55] <stymo> any flag you can get back from mongo?
[20:15:50] <mediocretes> 1.8 supports priority 0 or 1 only
[20:22:46] <armenb> Is there a straightforward way to merge two mongodb databases?
[21:29:38] <christopherbull> I'm trying to setup a db to load with --replset and --rest options, but it's currently being managed by a service script on AWS linux (redhat variant), can anyone point me to where I can set these config options either in the init script or in the config file?
[23:23:46] <christopherbull> I'm getting this error when I try to add a replica set node on ec2 "need most members up to reconfigure, not ok ". I've init'd the rs on the main node and just trying to add one more, can anyone shed any light?
[23:25:39] <zirpu> is the initial primary able to connect to the 2ndry?