PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Monday the 29th of October, 2012

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:23:14] <abrkn> can i run regular commands on a mongoose (node.js) connection? updates=coll.update(condition,updates,multi)?
[00:35:45] <mrpro> what's locked%
[00:55:19] <tpae> hello,
[00:55:32] <tpae> i was storing some values on mongodb, using arrays
[00:56:01] <tpae> i created a nested document (array type) and created dynamic key using today's date
[00:56:19] <tpae> usage.121026 => xxx
[00:56:38] <tpae> it created bunch of empty arrays that goes from usage.0 ~ usage.121026
[00:56:49] <tpae> thus increasing my db usage by many folds
[00:57:01] <tpae> what's the best way to handle this..?
[01:04:53] <tpae> ok.. it turns out i created usage field as an array
[01:05:03] <tpae> i changed it to an object and it works
[01:37:46] <asdfn> Hi. A have a question. I know that ObjectID in mongo is 12-byte binary string. Does it mean that representation of this in string is always 24 character length?
[02:30:57] <mrpro> whats log% in mongostat
[02:31:01] <mrpro> lock
[05:31:22] <glaksmono> hi anyone is around?
[06:34:41] <mrpro> can mongo log roll over?
[07:07:27] <ezakimak> I'm having trouble matching element objects in an array of a subdocument that *do not* have a specific key present
[07:08:32] <ezakimak> { s: { $exists: true }, s.c.k: { $exists: false } } doesn't seem to cut it
[07:10:07] <ezakimak> s.c is an array, i want to match the elements of s.c where k is missing
[07:38:17] <mrpro> damn this aint cool. mongo perf degrades big
[07:38:19] <mrpro> who wants ot help?
[08:05:55] <deepy> After two days of usage, my mongoDB coffee mug has gotten a huge crack in it
[08:06:11] <deepy> I suspect this is punishment for going from coffee to tea
[08:06:28] <deepy> Given that it appeared after I had put tea into it
[08:06:54] <Gargoyle> Mines only ever had tea in it! :)
[08:07:41] <Gargoyle> But it is a London 2012 one, so maybe they made the british ones more robust for Tea drinkers! ;)
[08:08:44] <deepy> :)
[08:08:57] <deepy> Luckily there is redundancy in this system, I have a spare mug at home
[08:09:23] <Gargoyle> A coffee mug replicaSet - awesome! :)
[08:34:31] <[AD]Turbo> hola
[09:10:57] <samurai2> hi, is there any simple way to test that my restoration data is the same as my original data? thanks :)
[09:19:33] <NodeX> write a script
[09:28:34] <ly_gs> diff
[09:28:36] <ly_gs> :-)
[11:04:52] <syskk> how to do a case insensitive search in MongoDB? my query right now is { $or : [ { id : diet_id } , { label : diet_id } ] } label should be case insensitive
[11:05:34] <NodeX> with regex
[11:05:36] <syskk> mmm StackOverflow is telling me to use a regex
[11:05:42] <syskk> right
[11:05:49] <NodeX> and that $or is not efficient
[11:06:29] <syskk> any way I could improve the query? I don't know in advance if diet_id is the id or the label name
[11:06:30] <NodeX> what some people do is this .... label:['lowercase','ProperCase']
[11:06:44] <syskk> not a bad idea
[11:06:45] <Gargoyle> syskk: "/searchforme/i" <-- Will not use an idex though. Not even if you anchor it at the start.
[11:07:13] <syskk> yea, I think I'll use a second attribute
[11:08:32] <NodeX> some people also do this .... idx_general :['all','of','the','strings','you','want','to','search']
[11:08:45] <NodeX> depends if you can live with that in your data
[11:37:46] <urbann> hi
[11:38:02] <NodeX> good morning
[11:38:23] <urbann> good morning!
[11:38:25] <urbann> I try to get mongo to work in a meteor app
[11:38:37] <urbann> the instructions say:
[11:38:38] <urbann> I try to get mongo to work in a meteor app
[11:38:45] <urbann> $ export MONGO_URL='mongodb://user:password@host:port/databasename'
[11:39:08] <urbann> I just don't understand what that mean ?
[11:39:22] <NodeX> paste it in your shell
[11:39:47] <NodeX> changing user, password, host, port, databasename for your user,password etc etc
[11:40:12] <urbann> I have tried but are not sure what syntax to use for my system
[11:40:24] <NodeX> syntax?
[11:40:44] <urbann> sorry, password, host, port, databasename for your user,password etc etc
[11:40:56] <urbann> my english are not so good!
[11:41:02] <NodeX> you must know the username / password of your database?
[11:41:09] <NodeX> you mist know the host your database sits on?
[11:41:17] <NodeX> you must know your database name
[11:42:05] <urbann> this is magic to me, I just can't figure out what I am doing
[11:42:14] <Derick> if you just have started mongo on localhost f.e., with no user setup, you can use: export MONGO_URL='mongodb://localhost/testDB'
[11:42:19] <urbann> how do I get the database name ?
[11:42:31] <Derick> if it's hosted, or somebody else setup the db, you need to use that information of course
[11:42:43] <Derick> instead of testDB, you can also pick your own name
[11:42:51] <Derick> no need to do a "create database"
[11:43:06] <urbann> thanks, I will try..wait
[11:49:15] <urbann> Derick: yes something happened now, got an new error : )
[11:49:31] <urbann> I want to know what I am doing now this is magic to me
[11:49:31] <urbann> what do the export command do?
[11:49:51] <Derick> it's a shell command - it sets an environment variable (off-topic question though)
[11:50:49] <urbann> off-topic question though .. sorry
[11:51:12] <urbann> so what I am doing here is set a path to the mongoDB ?
[11:51:17] <Derick> yes
[11:51:21] <Derick> it's called a connection string
[11:51:37] <urbann> I see
[11:51:45] <NodeX> similar to a DSN iirc
[11:51:50] <Derick> yes
[11:53:34] <urbann> I will try to read a bit about this, thanks for your hins!
[12:28:44] <preinhei_> Derick: could you clarify something for me? I'm not sure if Mongo::connect() should be returning true on success, or simply not throwing an exception. http://www.php.net/manual/en/mongo.connect.php
[12:38:33] <Derick> preinhei_: it can throw an exception
[12:38:49] <Derick> but, you shouldn't (have to) run connect() yourself
[12:39:08] <Derick> actually, let me check
[12:39:10] <preinhei_> Should I be expecting TRUE back when it works?
[12:39:15] <preinhei_> (the docs indicate bool)
[12:39:27] <Derick> it's not a method that should be user facing really :-/
[12:39:36] <preinhei_> In the latest build from git I'm not getting any response to it
[12:39:44] <Derick> we've been changing things
[12:40:07] <Derick> in master, it returns nothing, but can throw an exception
[12:40:40] <Derick> in v1.2 it returns a bool
[12:40:46] <Derick> seems that we changed that
[12:40:47] <Derick> meh
[12:40:55] <Derick> why are you calling connect yourself? :-)
[12:41:01] <preinhei_> heh.
[12:41:12] <preinhei_> I'm upgrading some of the code in Lithium to handle the newer features of the driver
[12:41:15] <Derick> right
[12:41:21] <Derick> no need to run connect()
[12:41:26] <Derick> it will connect on its own
[12:41:27] <preinhei_> It was formally passing connect -> true in the constructor
[12:41:35] <Derick> ah, that was the default
[12:41:44] <Derick> sorry, is the default
[12:41:46] <preinhei_> and its exception handling was designed to check for the connection problem there
[12:41:59] <Derick> yeah, the exception now comes from "new Mongo)
[12:42:05] <Derick> yeah, the exception now comes from "new Mongo()"
[12:42:14] <Derick> connect = true, has always been the default though
[12:42:33] <preinhei_> okay
[12:42:57] <preinhei_> At least one iteration of the driver returned that connect -> true was being deprecated
[12:43:12] <preinhei_> Is it just going to always connect?
[12:44:37] <Derick> no, connect = true/false still works
[12:44:47] <Derick> we probably undeprecated it :-)
[12:44:55] <Derick> also, I would wait until 1.3RC1 is out
[12:45:07] <Derick> we are still working on making safe-ness on by default
[12:45:46] <preinhei_> [Sun Oct 28 01:14:52 2012] [error] [client 24.246.57.214] PHP Deprecated: Mongo::__construct() [<a href='mongo.--construct'>mongo.--construct</a>]: The 'connect' option is deprecated and will be removed in the future in /var/www/api.wheresitup.com/libraries/lithium/data/source/MongoDb.php on line 259
[12:46:00] <Derick> maybe I'm wrong then!
[12:46:08] <preinhei_> I don't think I'm getting that anymore
[12:46:12] <preinhei_> oh, I'm not passing it now
[12:47:08] <Derick> we're removed the warning
[12:47:10] <Derick> we've
[12:47:15] <preinhei_> okay
[12:47:42] <preinhei_> My vote would be that you continue to return true from ->connect()
[12:47:47] <Derick> yes
[12:47:56] <Derick> preinhei_: can you add a ticket perhaps in JIRA so we won't forget?
[12:48:05] <preinhei_> and I'll stop calling ->connect all together :)
[12:52:10] <preinhei_> added. thanks.
[12:54:23] <Derick> thanks too!
[12:54:33] <Derick> I will be making some blog posts/announcements about the new stuff soon too
[12:54:51] <Derick> don't be too annoyed if we break new things/change things in master/1.3 :-)
[12:55:00] <preinhei_> yeah... about that.
[12:55:00] <preinhei_> :)
[12:55:37] <Derick> :-)
[13:07:09] <NodeX> Derick : what is "connect" being replaced with?
[13:10:25] <Derick> NodeX: it's not being replaced
[13:11:43] <NodeX> my mistake, I misread
[13:23:20] <Zelest> NodeX, do you use mongo and php?
[13:24:07] <Zelest> or, more correctly, is nginx 1.2, php-fpm 5.4, mongodb 2.2 and the php mongo driver available in debian/ubuntu? :)
[13:24:33] <Gargoyle> Zelest: Yes. I'm running that at the moment.
[13:24:49] <Zelest> debian or ubuntu?
[13:25:29] <Gargoyle> Grab ubuntu 12.10 for php 5.4, use the 10gen repo for mongo, and you can build the php driver from source in about 2 mins.
[13:26:18] <Zelest> Source scare me though.. as it will cause me to be lazy and never upgrade them once they're installed. :P
[13:26:26] <Zelest> Got all but the driver in Archlinux atm..
[13:26:29] <Derick> Zelest: pecl install mongo
[13:26:35] <Zelest> oh
[13:26:58] <Derick> you probably need to install the php5-dev package
[13:28:20] <Zelest> neither in arch :/
[13:28:20] <Zelest> urk
[13:28:34] <Derick> php5-devel
[13:28:36] <Derick> php-pecl?
[13:28:40] <Derick> whatever the name is
[13:28:41] <Zelest> none
[13:28:49] <Derick> or perhaps you can use a better linux? :-)
[13:28:55] <Zelest> mhm
[13:29:03] <Zelest> just setup a new machine, so no loss other than time :)
[13:29:23] <Zelest> if on mongodb 2.2 existed for freebsd :P
[13:31:17] <Derick> you like pain, don't you? ;-)
[13:31:24] <Derick> hellow Shawn
[13:31:58] <Zelest> haha
[13:34:53] <mbrown> I have a replica set question
[13:35:01] <Gargoyle> 42!
[13:35:03] <mbrown> I currently have a master and 2 secondaries in site A
[13:35:43] <mbrown> I want to add an additional site with a hidden replica
[13:36:02] <mbrown> Is that okay? Docs are all about setting up a clean replica set
[13:36:22] <Gargoyle> When you say hidden, you mean one that won't ever become primary?
[13:36:27] <mbrown> yes
[13:36:33] <mbrown> DR only
[13:36:42] <mbrown> Frankenstorm precaution
[13:36:48] <Gargoyle> Yeah, Something like giving it a priority of 0
[13:36:55] <mbrown> hidden=true
[13:37:10] <Gargoyle> But you probably want to make sure the number of votes in the RS is still odd.
[13:37:37] <mbrown> So add an arbiter as well?
[13:37:46] <mbrown> in site B?
[13:38:12] <Gargoyle> yup.
[13:38:25] <Gargoyle> Should help you avoid split-brain
[13:39:06] <Gargoyle> Well, technically, mongo does that by not electing a primary without a majority.
[13:39:38] <Gargoyle> Although, If it's for some kind of manual DR intervention, you might not need to worry about that
[13:39:47] <Derick> what's DR?
[13:39:57] <Gargoyle> disaster recovery
[13:39:58] <mbrown> If site A goes down completely, but B is available, what happens?
[13:39:59] <Derick> ah
[13:40:04] <Derick> silly acronyms :-)
[13:40:11] <Derick> mbrown: it becomes read-only
[13:40:43] <Derick> or in this case, when it's hidden... I don't know actually. i've never tried that
[13:41:49] <mbrown> I think hidden is not the right choice now that I think about it the actual scenario
[13:42:33] <Derick> you probably just want a low priority, but in order for a set to be read/write, a majority of nodes needs to be up
[13:43:57] <mbrown> exactly
[13:45:21] <Gargoyle> mbrown: So what you might want to think about is 2 nodes in site A, 2 in B and an arbiter somewhere else (site c)
[13:45:54] <mbrown> I don't think that;s right
[13:46:05] <Derick> why not?
[13:46:12] <mbrown> I think there must be a majority where the primary is
[13:46:26] <Derick> mbrown: yes, but the primary can be either in a or b in that case
[13:46:34] <Derick> you give in a, both nodes a priority of 2
[13:46:39] <Derick> and in b, a priority of 1
[13:46:46] <Derick> so if a is up, one of those is primary
[13:46:52] <mbrown> no majority of A looses internet connectivity
[13:47:05] <Derick> and if *none* in a are up, one of the ones in B is primary
[13:47:12] <Derick> the node in C is there to vote in that case
[13:47:34] <mbrown> Not the instructions from here - http://docs.mongodb.org/manual/tutorial/deploy-geographically-distributed-replica-set/
[13:47:51] <mbrown> Very last buller
[13:47:58] <mbrown> s/buller/bullet
[13:48:39] <Derick> I don't see how that conflicts with the A/B/C schema from what Gargoyle said
[13:49:38] <ralph___> The docs say that Site A needs to have a majority of voters, so an arbiter in C would leave A and B without majorities
[13:50:15] <Derick> ralph___: a node in B will have to be primary
[13:50:26] <Derick> (if both nodes in A are gone)
[13:50:40] <ralph___> What happens if C goes away?
[13:50:52] <Derick> just C, with A and B still up?
[13:51:03] <Derick> then a node in A is primary
[13:51:27] <ralph___> I guess I'm thinking of two site failures, in which case you're probably just boned
[13:51:32] <mbrown> I think I read the docs wrong. From what I understand, that scenario will work
[13:52:14] <Derick> http://derickrethans.nl/talks/mongo-tut-zendcon12.pdf page 122/123
[13:52:28] <Derick> ralph___: yes, than you have a problem :-)
[13:52:28] <lucian> i'm having trouble with a nested or. mongo won't use an index for something like {$and: [{$or: [...]}, {foo: "bar"}]}. is there some alternative?
[13:52:55] <Derick> why do you need an $and? It's the default
[13:53:03] <mbrown> Thanks for the help Derrick and Gargoyle
[13:53:05] <mitsuhiko> morning gents
[13:53:12] <Gargoyle> The mongo approach is very elegant and diplomatic, but I miss the "Samuel L. Jackson, Motherfucker" feeling of using a STONITH setup! :D
[13:53:38] <lucian> Derick: you mean {$or: [...], foo: "bar"} ?
[13:53:54] <Derick> sure
[13:54:02] <lucian> afaict that won't work for everything, though
[13:54:14] <lucian> and i'm not sure it uses an index either
[13:54:15] <Derick> what's in $or?
[13:54:34] <lucian> it's basically a permission check
[13:54:43] <lucian> a few equality checks and an array inclusion check
[13:54:55] <Derick> i don't care what it does - just wanted to see the full query
[13:55:05] <Derick> so that i can think of an index
[13:55:18] <lucian> let me generate one, brb
[13:57:07] <Gargoyle> Are there any downsides to using MongoBinData()? or more specifically, any pitfalls to gzipping and entire subdoc that never gets searched?
[13:57:58] <lucian> Derick: something like this https://gist.github.com/78b89c6929965ff78030
[14:01:47] <Derick> lucian: compound index on {y : 1, read: 1 } ought to be used
[14:01:50] <Derick> but drop the $and
[14:02:16] <Derick> Gargoyle: should work fine
[14:02:24] <Derick> Gargoyle: just make sure it's not more than 16MB though
[14:02:50] <lucian> Derick: is the $or always taken as second to an equality check?
[14:03:07] <Derick> no, but you have a fixed value for y
[14:03:21] <lucian> and that's why it's first?
[14:03:32] <Derick> yes, that's why you should have that first in your compound index
[14:03:41] <lucian> i see. thanks, i'll give it a shot
[14:04:18] <lucian> somewhat related, is there some documentation on how queries order in regards to a compound index?
[14:06:04] <Derick> there are a few tutorials and presentations I think - http://derickrethans.nl/talks/mongo-index-munich-mug is one I've given
[14:06:56] <mitsuhiko> Derick: will mongodb ever get a query optimizer?
[14:08:27] <Derick> lucian: and here: http://www.10gen.com/presentations/webinar/indexing-and-query-optimization-september-2012
[14:08:30] <Derick> mitsuhiko: it has one
[14:08:32] <lucian> Derick: thanks
[14:08:49] <lucian> Derick: shouldn't an optimised see both those queries as equivalent?
[14:08:52] <Derick> mitsuhiko: and I'm sure we'll improve the one we have in the future if we can
[14:09:06] <Derick> lucian: yes, for the query it doesn't matter - it does matter how you set the compound index though
[14:09:10] <Gargoyle> Derick: If we don't need sub-meter resolution (or anywhere near it), how big is the ipact of specifying the number if bits for a 2d index?
[14:09:27] <Derick> Gargoyle: it's storage size mostly then
[14:09:28] <lucian> Derick: it matters here. $and [ $or ] scans more than the one without $and
[14:09:44] <Derick> lucian: ?
[14:10:26] <Derick> lucian: it should be able to use the y, read index four times even
[14:10:35] <Derick> let me see
[14:10:40] <lucian> Derick: explain gives different results for {$and: [{$or: ...}, {y: 1}} vs {$or: ..., y: 1}
[14:11:14] <Derick> okay?
[14:13:02] <lucian> actually my mistake, explain does say the same thing
[14:13:41] <Derick> it works here: http://pastebin.com/vvyVXsgs
[14:13:47] <Derick> exactly as I expected
[14:14:17] <lucian> yeah, the one without $and does use the index
[14:15:33] <Gargoyle> lucian, Derick, Butting in on your convo… does the y:1 bit have to come first in the find() query if it's first in the compound index?
[14:16:00] <lucian> Gargoyle: hashes aren't ordered afaik
[14:16:23] <Derick> Gargoyle: no
[14:17:48] <lucian> anyway, thanks Derick. now i just need to write an optimiser and it should be able to use the index
[14:18:10] <Derick> optimiser for?
[14:18:26] <lucian> i compile a query language to mongodb query, then add permission check
[14:18:43] <lucian> so i have to split off the optimisation pass so i can apply it at the very end
[14:18:43] <Derick> ah
[14:18:47] <lucian> so it collapses $and
[14:20:38] <NodeX> Gargoyle : sometimes Mongo will get confused on those sort of compounds but that's what hint() is for
[14:20:48] <NodeX> (it doesn't happen alot)
[15:14:48] <nacer_> hi
[15:15:02] <nacer_> do someone know a way to tell the ruby mongo driver to launch this query : rs.status(); ?
[15:16:22] <kali> nacer: db.command("replSetGetStatus") or something like that
[15:16:42] <kali> nacer: i'm sure about the replSetGetStatus bit
[15:18:16] <nacer> kali: look nice ,let's try that
[15:27:49] <nacer> kali: it work tks
[15:48:49] <winterpk> Whats it mean if db.repairDatabase operation hangs?
[15:49:08] <winterpk> lol nvm just fininshed finally after 15 minutes
[15:50:31] <Gargoyle> winterpk: It means you need to read the docs where it tells you that it will take a long time!
[15:56:21] <NodeX> LOL
[16:13:59] <TecnoBrat> Morning all, question about the new TTL based collections
[16:14:20] <TecnoBrat> I have a collection with a date field already, and we do some manual cleanup of it nightly
[16:14:30] <TecnoBrat> however, we may have old stuff hanging around
[16:14:53] <TecnoBrat> if I add the index in 2.2 to make it TTL based, how aggressive is the cleanup going to be?
[16:15:16] <TecnoBrat> is it going to try to delete it all instantly, or is it going to slowly delete them as it catches up
[16:15:51] <TecnoBrat> I just don't want a massive locking / IO spike / slowdown because of enabling it, otherwise I'll try to manually clean it up first
[16:22:57] <TecnoBrat> Also, "ct" is what I want to add the TTL index on. I already have other indexes like: '{ "s.0" : 1, "f.0" : 1, "paid" : 1, "ct" : -1 }' .. the docs say you can't create it on a field that already has an index. Does this qualify? Or does it mean if I've indexed ONLY the "ct" field I would have to remove that index first
[16:23:14] <TecnoBrat> Also ... since this is an index, I assume its treated as such for queries
[16:38:10] <jawr> if i have a collection with documents that containt uid's, how can i get a results back with the sum of various fields
[16:38:27] <jawr> i.e. uid: 1, sum { kbytes }
[16:38:43] <jawr> meh $sum
[17:06:27] <NodeX> jawr : aggregation framework or map/reduce
[17:07:17] <Aric> is there any reason why a .find() would show the result but only give me four of the columns/keys instead of all 6?
[17:10:56] <NodeX> if you set it to retrieve a subset yep
[17:11:02] <NodeX> pastebin your query
[17:13:10] <Aric> i was just doing .find({})
[17:13:15] <Aric> well
[17:13:44] <Aric> .findOne({}) and it only gives me 4 of the 6 columns, may be a problem with the framework i'm using but eh i'll bother them
[17:17:06] <NodeX> It sounds like a framework thing
[17:20:19] <chovy> how do i migrate data in node?
[17:27:24] <NodeX> define migrate?
[17:28:14] <Gargoyle> Is it, strap server to 1,000 geese and let them carry it south for the winter?
[17:30:54] <NodeX> haha
[17:32:40] <NodeX> anyone do auto complete style suggestions on large datasets?
[17:36:14] <TecnoBrat> NodeX: yikes ... using regex's?
[17:36:21] <TecnoBrat> sounds like a nasty problem :(
[17:36:38] <TecnoBrat> I don't know that mongo would be my first choice for that
[17:37:04] <NodeX> No not in mongo
[17:37:11] <NodeX> in general does anyone do it in here?
[17:41:00] <spacemonkey> I've seen auto-complete with Elastic Search on hundreds of thousands of documents, but that's about it. Not sure if that is "large" for you though.
[17:42:11] <NodeX> I am talking 28M docs
[18:00:09] <doxavore> In MongoDB 2.0.7, I'm seeing it periodically lock up completely. I can't seem to catch something going on in db.serverStatus, but monogstat shows almost all counts go to 0, then it comes back with locked% over 500
[18:01:14] <doxavore> iowait hangs between 0 and 5 or 10%, but otherwise the server is responsive
[18:02:09] <TecnoBrat> doxavore: are you using M/R which merges into another collection?
[18:02:45] <TecnoBrat> I saw this exact behaviour on the final step of a M/R which has a merge into a collection, its the final save that caused it
[18:03:18] <doxavore> TecnoBrat: no M/R, but we are using gridfs
[18:03:30] <doxavore> (which I can't replace for something else fast enough)
[18:08:16] <jaimef> does it make sense to set vm.swappiness to 0 if mongo mmaps everything?
[18:25:59] <lucian> Derick: if you don't mind me bothering you again, i've found a case where i can't use an implicit and https://gist.github.com/78b89c6929965ff78030#file_or%20query.mongo
[18:26:15] <Derick> I'm sure there are cases :-)
[18:26:16] <lucian> Derick: do you have an idea of what i could do instead that would use the index?
[18:26:30] <lucian> well, this is a case i sort of care about :)
[18:26:52] <Derick> which one? I don't see the problem?
[18:27:04] <lucian> i can't have two $or in the same hash
[18:27:15] <Derick> ah, double $or
[18:27:16] <Derick> yeah
[18:27:16] <lucian> or query.mongo, like 17
[18:27:18] <lucian> line
[18:27:20] <Derick> that's not a possible one :-/
[18:27:33] <lucian> right. so is there something i can do instead, but still have the index used?
[18:27:56] <lucian> i tried to not the whole condition to turn it into an or, but that isn't supported
[18:28:16] <Derick> uh? that sentence I didn't understand
[18:29:11] <lucian> the logical trick of negating an expression to replace or with and
[18:29:30] <Derick> negations will prevent indexes from being used too
[18:29:38] <lucian> yeah, i noticed
[18:29:46] <jrxiii> anyone know how to prevent a cursor from timing out at the mongo command line?
[18:29:49] <lucian> it doesn't seem that there's anything i can do :(
[18:31:14] <Derick> lucian: I can't think of anything either :-/
[18:31:30] <Derick> except doing two queries and handle it on the client side
[18:31:57] <lucian> i see. the reason i'm trying to avoid that is because i'd mess with pagination
[18:33:52] <lucian> Derick: anyway, thanks for all the help :)
[18:34:49] <glaksmono> hi anyone is around?
[18:35:01] <jrxiii> Well, can anyone here confirm that db.coll.find().addOption(16) will make the cursor timeout unlimited
[18:38:25] <jrxiii> for those who care addOption(16) will make a cursor never timeout: http://www.mongodb.org/display/DOCS/Mongo+Wire+Protocol#MongoWireProtocol-OPQUERY
[18:52:40] <doubletap> I have data in my keys
[18:52:57] <doubletap> before i rebuild this collection, is there no way to index keys?
[18:55:33] <NodeX> no
[20:21:15] <jtomasrl> how can i update an array that is 3 levels deep in a json object?
[20:40:23] <wereHamster> { $push: { 'foo.bar.baz.the.array': 42 } }
[20:40:38] <wereHamster> jtomasrl: ^^^
[20:41:34] <_m> db.foo.update({ _id: ObjectId('123asd') }, { $set: { 'bar.1.baz.1.whatever' : 'some value' } })
[20:41:38] <jtomasrl> got it, db.stores.update({ name: "store", "tables.number": 1}, { $push: { "tables.$.users": { name: "user" } } })
[20:41:43] <_m> If you need to update the record rather than appending to it.
[20:42:09] <jtomasrl> something i dont get, what does the .$. do
[20:42:20] <_m> Positional operator
[20:42:33] <wereHamster> jtomasrl: it's documented. Go read the documentation.
[20:42:39] <_m> http://www.mongodb.org/display/DOCS/Updating#Updating-The%24positionaloperator
[20:42:54] <jtomasrl> kk thx
[20:43:03] <mediocregopher> I have a question regarding different ways of doing the same query and how indexes get applied to each one
[20:43:13] <_m> .explain()
[20:43:41] <_m> mediocregopher: http://www.mongodb.org/display/DOCS/Explain
[20:43:53] <mediocregopher> we're running version 2.0, if we do something like this: db.artistEvents.find({ $query: { arid: 1239926 }, $orderby: { _id: -1 } }).explain() our index doesn't get used, but if we do db.artistEvents.find({ arid: 1239926 }).sort({ _id: -1 }).explain() the index does get used
[20:45:05] <mediocregopher> according to http://www.mongodb.org/display/DOCS/Mongo+Query+Language these two queries should be the same, but it seems like they're not. our index looks like this: {
[20:45:07] <mediocregopher> "v" : 1,
[20:45:09] <mediocregopher> "key" : {
[20:45:11] <mediocregopher> "arid" : 1,
[20:45:13] <mediocregopher> "_id" : -1
[20:45:14] <_m> oh god
[20:45:15] <_m> Stop
[20:45:15] <mediocregopher> },
[20:45:17] <mediocregopher> "ns" : "feeds2.artistEvents",
[20:45:19] <mediocregopher> "name" : "arid_1__id_-1",
[20:45:21] <mediocregopher> "background" : true
[20:45:23] <mediocregopher> },
[20:45:26] <_m> Seriously. Stop.
[20:45:28] <mediocregopher> ?
[20:45:33] <_m> Pastie or gist that.
[20:47:26] <mediocregopher> https://gist.github.com/3976423
[20:47:28] <mediocregopher> sorry
[22:33:58] <mrpro> hi
[22:34:28] <mrpro> so like, if i am doing an insert via c# driver, there is no way to free up my thread until insert result comes back right?
[22:36:03] <mrpro> also, how to configure connection pool?
[22:36:15] <mrpro> size