[01:17:19] <multi_io> is there a way to establish a reader/writer lock in a mongodb database?
[01:18:27] <multi_io> i.e. such that you can perform multiple inserts/updates, all other reads and writes are blocked and don't proceed, but if the lock isn't held, read operations run in parallel?
[01:19:18] <multi_io> (I'm not talking about mongodb's own internal per-database r/w lock -- that one isn't customizable afaics, i.e. you can't make it span multiple write operations)
[01:41:04] <_aegis_> multi_io: sounds like a good way to slow things down :)
[01:41:47] <_aegis_> http://docs.mongodb.org/manual/reference/operator/atomic/ and http://docs.mongodb.org/manual/tutorial/isolate-sequence-of-operations/ ?
[05:09:22] <yarco> but by using db.close(), it will be ok
[05:09:38] <yarco> but then, i dont know when to use db.close...
[07:17:35] <bosyak> hi all. I can't query find() method with Spring Data. Please drop me an example?! mongo.executeCommand("{'find':'firststeps', 'article':'art222'}");
[07:30:10] <Ro__> Hello, I need GridFs with version-able files. After seeing some examples I found that python client has get_version method. Although php driver does not have this method (or I haven)
[07:30:21] <Ro__> Hello, I need GridFs with version-able files. After seeing some examples I found that python client has get_version method. Although php driver does not have this method (or I haven't found any).
[07:47:45] <yarco> when to use ObjectID and when dont have to do so?
[07:54:04] <Oddman> erm, have I done something wrong here?
[12:06:40] <BadCodSmell> Occasionally it runs out of memory, I have a fix for this, stop the server, delete the data files, reimport the data, restart the server, restart everything else
[12:07:01] <BadCodSmell> Is there an easy way to trap this error??
[12:07:29] <algernon> do you end up with more than 2Gb of data files?
[12:09:19] <algernon> using capped collections may be an option then
[12:09:48] <algernon> though, hm, since you reimport, capped collections won't really do what you want
[12:09:53] <BadCodSmell> It isn't really a problem with limitations
[12:10:27] <BadCodSmell> It's just is there a good way to trap the error you get outside of the application and mongo when you hit that limit?
[12:54:23] <osallou> Hi, I am trying to call the find method on a connection using python reflexion "db_conn.objklass.find(filter)" but I have errors: TypeError: 'Collection' object is not callable. This works fine if I use db_conn.User.find(filter). Anyway to use a class reference directly?
[13:57:40] <Virunga> I configured mongodb to listen on port 27017 and accept connection from a comma separated list of ips, and starting the service i get mongodb start/running, process 1804. Is it enough to let the service work?
[13:58:20] <Virunga> Because i can't connect from an other server with ip in the list...
[14:01:13] <Virunga> i can't connect from the host itself either
[14:09:56] <jeremy-> Is it possible to use a $in inside an $or statement
[14:11:11] <jeremy-> perhaps i just have bad syntax
[14:18:19] <timah> jeremy: if i were asking that very same question i would first start by challenging myself in finding a much healthier approach in accessing the data.
[14:22:32] <jeremy-> I doubt there is a healther way, i understand its an expensive query but its designed as opposed to doing an odd few dozen queries instead
[14:23:05] <jeremy-> Ie, against 3 different fields, ($or), search against a user defined array for each ($in)
[14:23:53] <jeremy-> The alternative is to only allow the user to do one of the 3 fields at a time, then it can be indexed, not sure if i want to restrict the user like that
[14:25:44] <jeremy-> Now when i try and do $in inside $or its not working
[14:28:15] <jeremy-> inside console i get: ReferenceError: $in is not defined (shell):1
[14:28:44] <jeremy-> Cause ive got a test case and its just one line i guess i can paste in here: { $or : [ { "firstfield" : $in ["val1", "val2"] }, {"secondfield" : $in ["val3", "val3"] } ] }
[14:54:35] <ichilton> I have a Groups model and I have a need to store 'affiliated groups' - I was thinking of having an array of group id's, but I need to store other details with them, such as the date they were affiliated and an accepted yes/no. What's the best way of storing that in MongoDB/Mongoid?
[14:54:40] <ichilton> In SQL, i'd obviously use a separate link table, in effect doing a many-to-many with itself.... but what's the right way to do that in MongoDB?
[14:58:10] <wereHamster> array of group ids and the additional data
[14:59:12] <wereHamster> group is { name: 'The Group', affiliatedGroups: [ { _id: X, accepted: true, affiliatedAt: Date }, ... ] }
[14:59:50] <ichilton> ah, so an array of hashes effectively?
[15:02:27] <NodeX> it normaly depends on your access patterns
[15:17:45] <jeremy-> Hello, on the node we were discussing before, I found out where my issue was after you guys gave me the advice, i created a pastie to try and explain my problem
[15:18:23] <jeremy-> Basically, I want to programmatically design some conditions for mongo that may or may not exist using php
[15:18:56] <jeremy-> If i write the statement and create a php associative array for each mongo statement, i can give each statement a curly bracket, but if i try and stack all my conditions in one array, they all share a curly bracket so it doesnt work
[15:24:19] <jeremy-> Its just i wanted to merge the subsequent array, $searchTerms
[15:24:28] <jeremy-> I figured it would retain child nesting but only merge the parent
[15:25:10] <jeremy-> The top statement works no problem
[15:25:36] <jeremy-> Just the bottom one, where i build the statement programatically, array( '$or' => array( $or_array )); the json_encode output turns out like the last line
[15:25:59] <jeremy-> which has all the {key1, val, key2, val, key3, val}
[15:26:11] <jeremy-> instead of {key, val}, {key, val}, {key, val}
[15:26:43] <jeremy-> so much harder to write mongo queries in php than python :D
[15:29:26] <jeremy-> Succinctly, I want print_r(json_encode($associative_array)) to put a curly bracket around each key/value, instead of only one curly bracket around the entire thing
[15:29:52] <jeremy-> so that it is valid for a mongodb $or statement
[15:30:01] <jeremy-> finally asked it in a way that isnt stupid :D
[15:30:09] <hersha> All of the sudden one of the databases on my shard cluster started throwing a "setShardVersion failed" on one of my nodes. This database has been running fine for 4 months with no problems. Any ideas?
[15:30:45] <jeremy-> i might be able to ask that question in php now that it is succinct
[15:34:25] <jeremy-> so you can write it like my original code, but then I dont know how to make it dynamic (conditionally not have one of the elements)
[15:34:39] <kchodorow_> hersha: try running db.adminCommand({flushRouterConfig:1}) on the mongos giving you errors (or restart it)
[15:34:56] <jeremy-> I'm probably busting your chops and im sorry to drain you as a newbie
[15:35:16] <hersha> kchodorow_: tried both of those
[15:36:42] <NodeX> it's fine jeremy- ... $or's can be confusing, give me a few mins, it's crazy busy here
[15:37:18] <jeremy-> now that i have actually written down the problem i think i may eventually get there myself too
[15:37:56] <jeremy-> Oh, you know how you could do it, create a for loop, and write every value of that array into a new array
[15:38:04] <jeremy-> then print the new array and presto the additional curly
[15:38:11] <BadCodSmell> I just did this to cram my db: http://pastebin.com/EX6ftESr I understand how you can get slack space when things aren't packed and mongo doesn't unallocate after removal, but this is pretty huge (6x), is there any documentation coverring specifically this kind of issue and minimising bloat?
[15:39:21] <timah> badcodesmell: i think i'm having a similar issue.
[15:39:46] <timah> i've asked my question a few times. however, seemingly at just the wrong time each time.
[15:40:04] <BadCodSmell> The reason I find this bloat weird is because all I rarely update and mostly mongo restore every now and again to it (poor man's replication), it's read only otherwise.
[17:19:17] <w0rmdr1nk> either way, when will we see better mechanism on config servers for sharding
[17:19:44] <w0rmdr1nk> something closer to a normal replica set rather than the three phase commit
[17:20:10] <w0rmdr1nk> cos I dont like the limitation of 3 config servers, especially if there is one production and one disaster recovery data center
[17:20:50] <Derick> w0rmdr1nk: I'm pretty sure that if you mail sales@ they'd talk to you
[17:21:37] <w0rmdr1nk> and in general I would prefer a config server on each node - especially with large clusters, otherwise there is more sensitivity on downtime for specific nodes.
[17:34:54] <drunkgoat> what would you say a better approach for a chat server with mongo: capped collection with tailable cursor or an indexed capped collection using a regular cursor?
[18:10:00] <timah> is it more performant to ensure a consistent document width within a collection vs. keys with null values?
[20:03:24] <Virunga> With the node.js mongodb driver, if one wants to perform an insert/update must retrieve the collection first and then make the operation. Does really retrieve the whole collection? Is there a more efficient way to do this?
[23:25:26] <bencc> is the source of http://try.mongodb.org available somewhere?