PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Thursday the 23rd of May, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:14:37] <kfox1111> Is there a way to get an insert to a collection in mongodb to never create the collection if it is dropped?
[00:17:26] <bjori> what
[00:17:54] <kfox1111> I have one process inserting periodically into a collection...
[00:17:55] <bjori> mongodb will implicitly create collections on-demand
[00:18:06] <bjori> and you want it to fail if the collection doesn't exist?
[00:18:41] <bjori> you would need to do some weird stuff with roles in 2.4
[00:18:47] <kfox1111> I have another one that I am having drop the collection. When dropped, I want the first process to fail insert, notice something happened, and choose the new collection.
[00:18:50] <bjori> but I don't think we have "can create collection" role yet
[00:19:34] <kfox1111> Long story short, I'm using capped collections, and need an easy mechanism to allow me to drop and recreate them with different sizes/etc and have the watchers pick up on it.
[00:21:21] <kfox1111> so no way to tell an insert to fail if collection does not exist?
[00:22:20] <bjori> no, not yet, the readWrite role allows you to create a collection
[00:23:23] <kfox1111> hmm.. so what I am thinking currently is, I have an "init" command that creates my capped collections. I have a process that listens on http and inserts into that collection, and I have a set of watchers that tail the collection.
[00:23:41] <kfox1111> When re'inited, it bumps a version, creates a new collection, and drops the old one.
[00:24:44] <kfox1111> the thing doing the inserting should notice the collection is gone and start writing to the new one. but it ends up recreating the old collection, and not even creating it as a capped collection causing things to misbehave.
[00:25:17] <kfox1111> a readWrite role wouldn't help in that case either, since it is the one doing the writing.
[00:25:31] <bjori> its a weird logic
[00:25:34] <bjori> why are you dropping it?
[00:25:50] <kfox1111> Because I'm making a new one, and I don't need the old one anymore.
[00:26:08] <bjori> well, since you don't care about the data anyway why do you need to resize it?
[00:26:30] <bjori> you could use ttl indexes to expire some data
[00:27:05] <bjori> you could create the new collection and then rename it to the old name
[00:27:17] <bjori> but there is probably a race condition there :)
[00:27:30] <kfox1111> that last bit was what I was trying to avoid.
[00:28:01] <kfox1111> There is some unique id's involved that need to be reset when rolling to the next collection.
[00:28:25] <kfox1111> Easily noticable when the collection name has the major version number in it.
[00:29:04] <kfox1111> The problem I'm trying to deal with is if I don't drop the collection, then the tailers will tail forever on a never going to change collection.
[00:29:49] <kfox1111> Once dropped, then when they try to recover, they notice the new db version and start tailing the correct collection.
[00:31:04] <kfox1111> The good news is, if I ensure the thing doing the insert is not running while I run the init program, it does work as expected, so I can work around it for now.
[00:31:49] <kfox1111> There still is a lacking feature there though where an insert/update needs to support a mode where collection creation is nonautomatic.
[00:40:16] <kfox1111> gtg. thanks.
[03:52:07] <MasterGberry> Does mongodb do replicating with data by default?
[03:52:26] <Derick> no, only if you setup replicasets
[03:52:44] <MasterGberry> Hmmm, does MongoDB allow for backups like mysql?
[03:52:53] <Derick> sure you can make backups
[03:53:01] <MasterGberry> ok, i know in cassandra u cant
[03:53:55] <MasterGberry> How does the data storage work exactly? I am interested in knowhing why mongodb db's take 192mb when first created?
[03:54:02] <MasterGberry> or is that not true?
[03:58:01] <Derick> it just reserves the space
[03:58:43] <Derick> you can specify --smallfiles --noprealloc
[03:59:04] <Derick> which reduces the file sizes for initial init, and noprealloc prevents preallocation
[03:59:09] <Derick> this will make things a bit slower though
[06:46:01] <seban> Hi, what does it mean that I have document with "_id" : "configUpgrade" in "state": 1 in my config.lock?
[07:43:50] <[AD]Turbo> hi there
[07:45:18] <seban> Hi, what does it mean that I have document with "_id" : "configUpgrade" in "state": 1 in my config.lock?
[07:50:51] <tagrudev> hello guys, how can I update a field's name in a collection
[07:51:24] <crudson> tagrudev: for all documents?
[07:51:33] <tagrudev> crudson, yup
[07:52:50] <crudson> tagrudev: http://docs.mongodb.org/manual/reference/operator/rename/#op._S_rename
[07:53:41] <tagrudev> working for 2+ ?
[07:54:53] <crudson> introduced in 1.7.2 according to docs, but I see in 2.2 some behavior was changed, so I'd review that page for expected results.
[07:55:25] <tagrudev> so this is going to work for 2+ ?
[07:56:13] <crudson> tagrudev: that is implied by my previous comment, yes. Give it a whirl and see.
[07:56:30] <tagrudev> k ty
[07:56:34] <crudson> gl
[08:04:57] <someprimetime> yo
[08:04:59] <someprimetime> who's up
[08:05:05] <someprimetime> i need a human support mongo tech
[08:11:32] <crudson> someprimetime: ask a question. someone will help if they can.
[08:20:35] <igungor> hello
[08:22:10] <igungor> '$and' does not 'AND' as expected for me (mongod 2.4.1)
[08:24:00] <joannac> igungor: Do you have a testcase? Or more detail?
[08:27:36] <igungor> joannac: i've prepared a test case, its results with mongod logs and all, but the problem was that i should be using elemMatch
[08:28:00] <igungor> thanks anyway joannac :)
[08:43:41] <someprimetime> should I create an array of children comments inside one parent comment in my comments collection?
[08:44:20] <someprimetime> or create a new entry for each record and just mark them as having `parent_id` !== null
[08:44:38] <someprimetime> if not null then it'd be referencing another record which would be its parent
[08:58:47] <crudson> someprimetime: if comments can be indefinitely nested then keep them as top-level entities and link to parent. querying will be a headache otherwise.
[08:59:04] <someprimetime> crudson: ah forgot to mention it'll just be 1 level deep
[08:59:10] <someprimetime> parent > child | child | child
[09:22:06] <crudson> oh he left - I had to attend to a raccoon eating a cat outside my window.
[09:23:24] <joannac> crudson: ...for real?
[09:23:54] <kali> it's supposed to taste like rabbit
[09:24:25] <crudson> uh huh. I just moved to the US pacific north west and the wildlife here is a bit weird. The noises these things make...
[09:26:14] <crudson> but nothing like hearing vixens shriek at night when I lived in the English countryside...chilling
[09:40:04] <Nodex> telnet towel.blinkenlights.nl
[09:40:13] <Nodex> hilarious ... watch what happens to your ssh window
[09:42:10] <anton123> I have a collection users with telephone key, in this there are numeric values also string values. When I try to find any number which is numeric in the collection it does not show but the string values are coming in the search.
[09:42:51] <anton123> I used mongoimport to import from mysql
[09:43:25] <Zelest> any telnet that doesn't swallow my ^C should die in a fire.. no matter how cool they are :(
[09:44:13] <Nodex> did you watch it Zelest?
[09:44:24] <Zelest> mhm :)
[09:44:33] <Zelest> there's another one with nyancat :D
[09:44:36] <Nodex> anton123 : please pastebin your query
[09:44:40] <Zelest> can't remember where though
[09:51:02] <anton123> I am using mongodb with php and this is the array I am passing: $column='telephone';$collection->find(array($column => '9899980668'));
[09:51:47] <anton123> if i pass something like +91123456 which is a string it shows the result
[09:52:13] <anton123> but not 91123456 if its a numeric entry
[09:52:32] <crudson> reminds me, is almost Towel Day
[09:53:25] <anton123> should i use $type for it?
[09:56:54] <Nodex> anton123 : you're passing a string to the query
[09:57:54] <Nodex> which means your values are probably saved/stored as strings
[09:58:43] <anton123> values are stored both in string and numeric format in the key telephone while i did mongoimport from mysql. those which had - or + were converted into string and others as numbers
[09:59:11] <anton123> how can i pass the search term as both numeric and string
[09:59:55] <Nodex> using an $in
[10:00:19] <Nodex> find('telephone'=>array('$in'=>array('123',123)));
[10:00:27] <anton123> will it give me both the +1-989898 and 1989898 values?
[10:00:48] <Nodex> find('telephone'=>array('$in'=>array('+1-989898',1989898)));
[10:02:10] <anton123> actually there is an input box where I will pass something like 9898 and it should show both the numeric and string entries. I used regular expression /searchterm$/
[10:02:40] <anton123> it shows only non-numeric values
[10:03:11] <Nodex> you really should clean your data tbh
[10:05:34] <anton123> how can i change the data type of that key to string for all the data?
[10:06:16] <Nodex> by casting it to a string
[10:07:21] <anton123> in telephone field if i search only 9 it shows me all the entries which are in string value having 9 in it. where as the phone numbers which are numeric and contain 9 doesnt show up
[10:07:35] <anton123> how can i show both numeric and non numeric in my search
[10:08:22] <Nodex> I just told you, use an $in
[10:08:29] <anton123> in mysql if i use like '%9%' it would show me all the values
[10:08:37] <Nodex> then use mysql :)
[10:09:03] <anton123> I just need to use that functionality in mongo.
[10:09:27] <Nodex> ok, last time. Use an $in
[10:09:31] <Nodex> or FIX your data
[10:10:00] <anton123> let me try. Thank you for your help
[10:33:27] <Hounddog> hi there, what would be the best way to store json to a specified column? array or convert the json t string?
[10:34:01] <Nodex> depends how you need to access it
[10:35:05] <Hounddog> well i am recieving tweets and items from instagram so i have 3 fields, type, item_id and description in the description i just want to save to complete json recieved from twitter or instagram
[10:36:06] <Hounddog> am quite new to mongo so bare with me :)
[10:37:02] <Nodex> if you dont need to query the json then I would save it as a string
[10:37:46] <Hounddog> well not really, just have to send the json later back to the client but that can be a conversion also
[10:37:55] <Hounddog> thats why i save the id in item_id
[10:38:07] <Hounddog> of the tweet or of instagram the id i mean
[10:41:01] <Hounddog> Nodex: thx
[10:41:40] <Nodex> :)
[11:16:06] <remonvv> \o
[11:18:09] <remonvv> Does anyone know how mongos manages its connections? Meaning, if I make X connections to mongos will it make X connections to each shard resulting in SHARD_COUNT * X total connections on the mongos instance?
[11:18:35] <remonvv> Or will it start reusing connections at some point. I'm having trouble finding info on this.
[11:19:10] <spolu> hi, when running a find with readPreference: secondary, I see duplicate records coming from chunk that were recently migrated. When running the find on the primaries (no readPreference) the document appears only once. Anybody has a clue as to why?
[11:22:09] <remonvv> spolu, perhaps the scenario where the secondary of the old shard still has a copy because it hasn't reached the migrate in the oplog yet and the secondary of the new shard already processed the migration.
[11:22:42] <spolu> remonvv: after how long should I start to worry?
[11:23:48] <remonvv> No idea, that's speculation at best. I'd normally assume this wouldn't be possible (since it allows to return 2 documents with the same _id for example, which is the case here I assume).
[11:24:04] <spolu> remonvv: yep
[11:24:46] <remonvv> Right. I suppose it's still eventually consistent if it fixes itself
[11:24:52] <remonvv> How long ago was this migration?
[11:25:15] <spolu> remonvv: no clue anything between a few hours to 2days (added a shard to the cluster)
[11:25:24] <spolu> remonvv: is there a way to check?
[11:25:41] <remonvv> Not easily.
[11:25:53] <spolu> remonvv: I know the value of the shard key of at least one of the culprit document
[11:26:03] <spolu> remonvv: yep I guess I have to go through my logs right?
[11:27:19] <remonvv> Yes, but even that won't help you much.
[11:27:31] <remonvv> what does replSetGetStatus return? no issues?
[11:31:41] <spolu> remonvv: well I have one node down (was dysfonctional) in that replica set
[11:32:05] <spolu> remonvv: will be replaced today, but otherwise no issue
[11:32:26] <spolu> remonvv: master: "optime" : { "t" : 1369308676, "i" : 2 }
[11:32:52] <spolu> remonvv: replica: "optime" : { "t" : 1369308677, "i" : 53 }
[11:40:55] <quattro> I have a shared replica set where 1 collection/db is sharded (3x2 replica's)
[11:41:30] <quattro> i need more read capacity on one of the replica sets since there are some other collections on it that need more reads, can i just make it 5 replica's on one and 3 on the other?
[12:09:19] <Snebjorn> will $match take advantage of indexes after an $unwind? For example db.text.aggregate({$unwind: ...}, {$match: ...})
[12:24:47] <binnyg> I am unable to do a query with java driver. fineOne() works fine but find with a query object is throwing an error(java.lang.IllegalArgumentException: can't serialize class com.google.common.base.Present).
[12:25:32] <binnyg> any clue as to what's happening?
[12:28:33] <remonvv> The error tells you what's happening.
[12:28:52] <remonvv> You're putting a Present object in your DBObject and it can't serialize that.
[12:29:08] <binnyg> but why is it working with findOne()?
[12:29:21] <binnyg> well I am reading from DB
[12:29:29] <remonvv> It isn't.
[12:31:19] <binnyg> may be I wasn't clear. I have a collection and I am trying to search the collection. I started with findOne() and can see the result. When I try to use find on collection with a query I get the above error.
[12:32:54] <remonvv> Paste your code
[12:32:57] <remonvv> Easier ;)
[12:33:10] <remonvv> There's no way a findOne() wont throw an error where find() will with the exact same query.
[12:34:09] <binnyg> http://pastie.org/7947594
[12:40:15] <remonvv> What's "name"?
[12:40:37] <remonvv> rurals.findOne() doesn't have conditions, your find() does.
[12:40:56] <remonvv> the "name" field is most likely a Present object, which makes that code broken
[12:41:27] <remonvv> Sure you don't need name.get()?
[12:41:35] <remonvv> Or deeper.
[12:42:15] <binnyg> shame on me
[12:42:49] <binnyg> let me try and will update you shortly
[12:44:25] <binnyg> name is a google Optional class which I totally missed. It works. Thanks remonvv
[12:44:40] <remonvv> np ;)
[13:08:42] <fatih> hi everyone
[13:09:37] <fatih> I have field named "foo" with lots of subfields. I can test a subfield via {"foo.subfield" : {"$exists" : true}}, however {"foo.sub.field" : {"$exists" : true}} doesn't work
[13:09:49] <fatih> I mean the subfield can contain "dots"
[13:10:05] <fatih> therefore I tried {"foo.sub\uFF0Efield" : {"$exists" : true}}
[13:10:20] <fatih> however the the find() query doesn't return anything for this
[13:10:25] <fatih> what I am doing wrong here?
[13:43:55] <Nodex> fatih : are you sure dot notation is not working?
[13:44:27] <fatih> I've tried anything Nodex, for queryin I'm using monoghub (a gui client on mac osx 10.8)
[13:44:51] <fatih> now I'm changing my codebase (data structure) that the subfields will be not keys anymore
[13:45:02] <fatih> that's really sad because it will cost me lots of time
[13:46:27] <Nodex> https://gist.github.com/AlexMcauley/5636185
[13:46:33] <Nodex> works find for me :)
[13:46:40] <Nodex> fine*
[13:46:55] <fatih> a dont' have a dot
[13:47:02] <fatih> these are single characters
[13:47:19] <Nodex> eh?
[13:47:21] <fatih> try to insert something like "sub.field"
[13:47:30] <fatih> where it contains a dot inside the field
[13:47:32] <fatih> see?
[13:47:33] <Nodex> you can't use "." in your key names
[13:47:39] <fatih> I can
[13:47:41] <Nodex> it's an invalid char
[13:47:44] <fatih> I'm using already
[13:47:50] <Nodex> well you shouldn't be
[13:48:05] <fatih> http://stackoverflow.com/questions/8429318/how-to-use-dot-in-field-name
[13:48:14] <fatih> yeah stupid decision
[13:48:29] <fatih> but it is user generated therefore I don't have much control over it
[13:48:32] <Nodex> for exactly this reason
[13:48:42] <Nodex> replace it at insert
[13:48:45] <fatih> and I don't want to change it on the client
[13:48:53] <Nodex> then you're out of luck
[13:49:18] <fatih> anyway thank you
[13:49:25] <Nodex> no probs
[13:50:50] <fatih> ok when I have an array with items like {"name":"foo", "date":"123"}, {"name":"bar", "data":"124"}
[13:51:04] <fatih> how can I use update together with pull
[13:51:16] <fatih> to remove the item with the name "bar" ?
[13:51:45] <Nodex> what's the name of your array?
[13:52:12] <fatih> foobars
[13:52:37] <fatih> i've read the doc but couldn't get around it
[13:52:57] <Nodex> do you want to pull the entire object from the array?
[13:53:10] <fatih> yes the entire object, removing the item from the array itself
[13:53:12] <Nodex> or just the "name"
[13:53:26] <fatih> it was length of two, after removing it should be length of 1
[13:53:33] <Nodex> db.foo.update({"foobars.name":"bar"},{$pull:{foobars.$:1}});
[13:53:37] <Nodex> somethign like that
[13:54:28] <fatih> thats a new syntax fro me
[13:54:31] <fatih> the second one
[13:54:40] <fatih> what does foobars.$ means?
[13:54:43] <Nodex> it's called the positional operator
[13:54:51] <Nodex> and it means the "matched" part of the array from the query
[13:54:52] <fatih> and this :1 removes it ?
[13:54:59] <fatih> ok
[13:55:26] <Nodex> I dont see why $pull : {name:"bar"} doesnt work?
[13:56:09] <fatih> then how should be the complete update command ?
[13:56:11] <fatih> I can try it
[13:56:18] <Nodex> 1 second
[14:06:45] <Nodex> ok that was a headache
[14:07:37] <Nodex> http://pastebin.com/3SCbYDrj
[14:10:55] <fatih> but I dont have any id
[14:11:03] <fatih> it is just some random variable I guess?
[14:11:11] <fatih> where id can be foo or bar?
[14:11:29] <Nodex> lol
[14:11:33] <Nodex> id == name in your case
[14:11:56] <Nodex> "_id" is the ONLY forced key/value in Mongodb
[14:11:59] <Nodex> the rest is up to you
[14:12:11] <fatih> ok nodex, tryin now
[14:17:42] <fatih> Nodex thank you very much works great :)
[14:18:09] <Nodex> no probs
[14:18:11] <fatih> now I have to find a better way to insert data into the array
[14:18:34] <fatih> currently I'm getting the whole collection, modifieng it and then do an update
[14:18:41] <fatih> but this is not the way I should do
[15:20:09] <remonvv> How is it that wherever I am in the world I get periodically disconnected for no apparent reason.
[15:21:04] <Nodex> it must be you
[15:21:13] <remonvv> NodeX--
[15:21:36] <Nodex> ++
[15:21:42] <Nodex> +/- ~
[15:21:47] <remonvv> No, definitely minus minus
[15:21:57] <Nodex> nope, that upsets the balance in the force
[15:22:08] <remonvv> You are one less now, possibly. Unless you were accessed from a different thread.
[15:22:23] <Nodex> no atomicity here, my update wins
[15:23:21] <Nodex> I'm banned from /dev/null
[15:23:24] <Gargoyle> :P
[15:23:34] <Nodex> my home is /dev/urandom
[15:25:13] <Nodex> @/fef50262710cd2862196ff82a02750ad8a728fea/
[15:25:15] <Nodex> oops
[16:16:40] <LzrdKing> is there a way to retreive detailed statistics about a database from the mongod http interface? like what http://127.0.0.1:28019/listDatabases?text=1 provides, only more information than just sizeOnDisk, like number of collections, indexes, objects, etc
[17:07:48] <yann_ck> Hello Guys, Is it possible to aggregate items, group them to get a min and output the corresponding document id?
[17:08:45] <yann_ck> db.items.aggregate({$group: {_id: "$user_id", min: {$min: "$created_at"}}})
[17:09:05] <yann_ck> like that but with the _id of the corresponding document
[17:10:21] <Nodex> look at $project
[17:10:34] <yann_ck> Thanks for the hint Nodex
[17:10:43] <Nodex> ;)
[17:11:37] <LzrdKing> is there a way to retreive detailed statistics about a database from the mongod http interface? like what http://127.0.0.1:28019/listDatabases?text=1 provides, only more information than just sizeOnDisk, like number of collections, indexes, objects, etc
[17:11:45] <yann_ck> I can do smthing like $project: { min: {$min: "$created_at"}}
[17:20:14] <yann_ck> I have something like Item.collection.aggregate({"$project" => { _id: 1, user_id: 1, created_at: 1}}, {"$group" => {:_id => "$user_id", "min" => {"$min" => "$created_at"}}})
[17:20:29] <yann_ck> but can't find how to outpout more fields in the $group
[17:22:02] <yann_ck> And even tried to put item_id: "$_id" in the group
[17:22:07] <yann_ck> and that output exception: the group aggregate field 'item_id' must be defined as an expression inside an object
[17:30:49] <Nodex> {:_id =>
[17:30:55] <Nodex> not sure the ":" helps
[17:32:37] <LzrdKing> no one knows about the http interface?
[17:33:15] <Gargoyle> LzrdKing: get rockmongo.
[17:33:43] <LzrdKing> not what i'm looking for
[17:34:08] <LzrdKing> i want to monitor (with zabbix), not admin
[17:34:31] <Gargoyle> then query the db direct (dunno what zabbix is)
[17:34:48] <LzrdKing> this information is not provided via http?
[17:35:16] <LzrdKing> here is what i get from the url i posted: http://pastie.org/7944853
[17:36:55] <LzrdKing> it'd be a lot simpler for me if the data is available via http
[17:38:06] <LzrdKing> i like rocklobster better anyway
[17:44:36] <LzrdKing> so i must be right, no one knows about the http interface
[17:50:15] <yann_ck> sorry Nodex, translating from Mongoid and ruby:$
[18:08:00] <Gargoyle> LzrdKing: About as much as you know about google it seems! http://docs.mongodb.org/ecosystem/tools/http-interfaces/
[18:11:41] <Mech0z> Is it not possible to change the value of a primary key?
[18:12:00] <Gargoyle> Mech0z: No. PK are immutable
[18:12:08] <Mech0z> hmm okay
[18:12:13] <Gargoyle> Save a new doc, delete the old one
[18:12:27] <Mech0z> year thats a solution
[18:15:24] <jaCen915> Hi, does anyone know how to query for documents using $where and $in AND sorting those results?
[18:16:30] <Gargoyle> Yes!
[18:16:54] <kali> jaCen915: you're aware $where is a bad idea ?
[18:17:23] <jaCen915> kali: That's good to know, I'm looking at legacy code and making updates
[18:17:42] <kali> jaCen915: avoid anything that use javascript
[18:18:11] <Gargoyle> Like nodejs… use PHP instead! ;)
[18:18:20] <kali> ho yeah. avoid node :)
[18:19:54] <jaCen915> kali: why is $where considered bad practice
[18:20:58] <kali> jaCen915: it's just slow
[18:21:33] <jaCen915> kali: looking at this legacy code, using $where and $in seems redundant yes?
[18:21:34] <kali> jaCen915: it also used to raise huge concurrency problems (only one js interpreter per process) but that bit is supposed to be solved since 2.4
[18:22:12] <jaCen915> kali: okay
[18:22:20] <kali> jaCen915: $in will be quite fast, and the index will be able to optimize it and restrict the number of docs to pipe through the $where
[18:23:31] <jaCen915> kali: are you saying where is okay to use if restricting the doc results with $in or that $in by itself is good enough
[18:24:26] <kali> jaCen915: it depends what you do with the $where... $where allow to express virtually any condition whereas the native operators have a finite featureset
[18:24:39] <jaCen915> okay
[18:24:50] <jaCen915> kali: the code I have works and there are no complaints
[18:24:56] <kali> jaCen915: good. :)
[18:24:59] <jaCen915> kali: my original question is with this code:
[18:25:01] <jaCen915> this.where("currentStatus").in(searchStatues).exec(cb);
[18:25:06] <jaCen915> can i apply a sort to this?
[18:25:08] <kali> ha.
[18:25:10] <jaCen915> I get errors on it
[18:25:12] <kali> this is not a where :)
[18:25:23] <jaCen915> ahhh using mongoose :P
[18:25:25] <kali> i mean, not a $where :)
[18:25:39] <jaCen915> so ideally it's converting
[18:25:44] <jaCen915> but if you don't know mongoose no worries
[18:26:07] <kali> i guess this is mongoose translated, i would assume it generates currentStatus: { $in : <searchStatue> }
[18:26:14] <kali> which is fine.
[18:26:20] <jaCen915> to rephrase…is it possible to sort in Mongo with where AND in?
[18:26:42] <kali> yeah. but mongodb will refuse to sort more that 1000 document without an index
[18:27:08] <jaCen915> will not have nearly that much so that's fine
[18:38:31] <jaCen915> kali: got it :)
[18:38:38] <jaCen915> mongoose documentation is broken :P
[18:38:52] <jaCen915> never trust third parties
[18:39:12] <kali> i said, don't use javascript :P
[18:39:23] <jaCen915> haha
[18:39:37] <jaCen915> ain't no choice when it's someone else's code you have to manage ;)
[18:56:37] <orospakr> hey, I'm having a bit of trouble using the fancier query selectors when nesting: https://gist.github.com/orospakr/5638498 (I assume I've probably made a goofy mistake)
[18:56:50] <orospakr> basically, a query that presumably should match, doesn't.
[19:01:03] <kali> orospakr: wtf is "value1" there for ?
[19:01:17] <Gargoyle> D'oh, kali beat me!
[19:01:19] <Gargoyle> ;)
[19:03:25] <orospakr> oho. It seems that I misunderstood the documentation.
[19:04:02] <orospakr> and that's done it. heh.
[19:04:07] <orospakr> *facepalm*
[19:04:10] <orospakr> thanks kali.
[20:04:52] <LzrdKing> Gargoyle: i was thinking more along the lines of http://docs.mongodb.org/manual/reference/command/nav-diagnostic/
[20:05:22] <LzrdKing> most of those commands work over http, but very few give me info about the individual databases
[20:07:02] <Gargoyle> LzrdKing: Well, if the built in interface isn't up to mustard for your needs, that leaves you one solution...
[20:07:38] <LzrdKing> yeah, learn php and hack up this script that gets the data i want , but not in a way i can use
[20:07:59] <Gargoyle> 1.) PHP can output JSON.
[20:08:22] <Gargoyle> 2.) You mean "Learn whatever language you like" ...
[20:08:55] <LzrdKing> yes, except that if i learn pythion, this php scrip that does 90% of what i need won't help me at all
[20:08:59] <LzrdKing> python*
[20:09:20] <LzrdKing> http://code.google.com/p/mikoomi/wiki/03
[20:38:58] <LzrdKing> wtf? somehow i created empty databases called collStats, connPoolStats, and listCommands just by curling some urls
[20:52:40] <ThePrimeMedian> can someone help me with a query? I am using mongoose.js (for node.js) here's my schema: http://pastebin.com/VKn2Q7Z3 but what I need is to find all Quest documents that match challenges.metric='user.sigin' and challenges.required >= 5
[20:52:58] <orospakr> is it possible to use $elemMatch on an array of strings rather than an array of objects? I'd like to use the $ operator and while using the flat { myarray : "value_to_match_in_array" } matches, the positional operator is not aware of it.
[20:53:49] <orospakr> (my goal is to replace a string in an array with a different string in a single update operation, if I can)
[21:05:57] <orospakr> (if given a string to match, $elemMatch complains that the parameter is invalid)
[21:13:18] <ThePrimeMedian> anyone?
[21:14:21] <Derick> sorry, missed the question ThePrimeMedian
[21:16:48] <ThePrimeMedian> can someone help me with a query? I am using mongoose.js (for node.js) here's my schema: http://pastebin.com/VKn2Q7Z3 but what I need is to find all Quest documents that match challenges.metric='user.sigin' and challenges.required >= 5
[21:16:52] <ThePrimeMedian> @ Derick
[21:20:04] <Derick> ah, I don't know much about mongoose :-/
[21:20:23] <ThePrimeMedian> ok, in MongoDB how would you do it?
[21:23:35] <jaCen915> ThePrimeMedian: what's the name of the db you're using for this
[21:24:07] <jaCen915> and can you connect to mongo directly? or only via mongoose?
[21:25:06] <ThePrimeMedian> jaCen915: I can connect to mongodb; mongoose is just an ODM ontop of Mongoose. So if we can figure out howe to make this query, I can adjust it for Mongoose
[21:25:11] <ThePrimeMedian> my DB is named whitedrake
[21:26:23] <jaCen915> ThePrimeMedian: cool…I'm using mongoose right now, let me play around real quick, for now look up the mongo "find" and "gte"
[21:27:22] <ThePrimeMedian> jaCen915: cool. I know how to use MongoDB and MongooseJS - but I have never tried to query an object by it's name inside an array inside a document. and get the document..... know what I mean?
[21:27:52] <jaCen915> ThePrimeMedian: exactly :) i haven't either, I want to see if my ideas will work
[21:28:05] <ThePrimeMedian> awesome. thanks hallas
[21:28:14] <ThePrimeMedian> oops.. sorry hallas i meant jaCen915
[21:28:20] <ThePrimeMedian> (too quick on the tab key)
[21:28:37] <jaCen915> ThePrimeMedian: no worries, and you want the entire quest document back?
[21:29:01] <ThePrimeMedian> yes.
[23:33:37] <iNick> Hi guys. We have a realization of someone else's stupid idea. We have 3x servers in a replica set and the hosts entered for the replicaset are static private nonrouteable IPs. Where is the replicaset info stored, since we only backup one database daily
[23:39:58] <redsand> iNick: its shared amongst them
[23:40:08] <redsand> all mirrored
[23:40:18] <redsand> each replica member is expected to be a copy of another
[23:46:07] <iNick> redsand: maybe I should rephrase... is replset info in the master db, in the production db we're backing up..?
[23:52:01] <iNick> in other words; how can i restore replset info?
[23:59:13] <redsand> iNick: i dont know how you care backing up the data
[23:59:18] <redsand> s/care/are
[23:59:28] <redsand> but you can get a copy by running rs.conf()
[23:59:39] <redsand> and back it up during backup time just to be sure