[01:25:43] <maeldur> Hey if anyone is around I have a sharding/replication question
[01:38:11] <dan__t> 'evening. pretty new to mongo.. reading up on config object definition, as shown in the replica set tutorial. wondering if i can drop that configuration in a file and then use that as stdin or piped to mongo?
[01:39:11] <dan__t> in the man page i read a lot about noninteractive use. i'm hoping this functionality extends in to replication pieces.
[01:39:33] <dan__t> mm, also from the man page, mongo script1.js script2.js script3.js
[01:51:40] <maeldur> are replica sets aware of what shard they're in, or is that all handled by the config server?
[02:01:12] <dan__t> i have what i think is a valid config for importing some replica set data in to... I run it through mongo and I don't see anything show up with rs.status(). http://pastebin.com/uUY1nRHR
[02:31:02] <dan__t> is there a way to initialize replication even when other replicas are unavailable? thinking down the lines of, eventually, they will all be up at the same time
[02:31:24] <dan__t> I was looking in to rs.slaveOk() but I don't think that's quite what I want
[02:32:42] <das3in> hi, I'm really new to backend development and am specifically having a hard time wrapping my mind around efficient data modeling. I want to have a dropdown menu where the user can choose to charge either hourly or a flat rate. Is the best way to do that est_cost_hourly = {type: Number, hours: Number}, est_cost_flat = {type: Number} as 2 separate fields in my Schema, and leave one of them null?
[02:57:22] <jsonperl> what privs do I need to db.setProfilingLevel(1), it gives me an unauthorized error. I'm already "userAdminAnyDatabase", "readWriteAnyDatabase", "clusterAdmin", "dbAdminAnyDatabase"
[03:05:40] <maeldur> if anyone was wondering, the answer to my previous question was yes, the mongo repl set members remember about the shard config and need to be restarted before a new shard config work
[03:27:02] <brizna> Does anyone know the running time of db.foo.find({"indexed_key": "bar"}).count() and/or how it works?
[03:38:19] <caitp> I need to find a list of documents within a collection, where a given ObjectId is found in a subdocument array of documents in that collection , and it's not an array of ObjectIds for some reason, so I don't think I can use $in, but rather just an array of objects with a single key pointing to an ObjectId
[03:38:26] <caitp> and I have no idea what a query for this would look like
[03:42:02] <caitp> the documentation says it's regarding updates as well, but this is a read only query
[03:42:17] <caitp> i dunno if it's a misnomer or what
[03:43:12] <caitp> I've got an object, I need to find a list of objects where that object is referenced in a subdocument, because someone had very interesting ideas when designing this system
[03:43:25] <retran> you would refer to array position then, i think
[03:44:23] <retran> maybe i'm not understanding your question
[03:44:33] <retran> are you just wanting to link between two objects?
[03:45:54] <caitp> a User is granted access to areas of a Campus by being granted a list of Zones (groups of Locks) for which they are allowed to enter
[03:46:13] <caitp> the Lock sends a message to a webserver saying "hey, someone is trying to open me, here's their RFID number, can I open up for them?"
[03:46:58] <caitp> the webservice needs to say "okay, let me find you based on where the request came from... okay I've found you, now lets see if this user is allowed to open you, by checking if you appear within any of the Zones that they have access to"
[03:47:58] <caitp> so, based on a Lock (which is a member of zero or more sets of Zones/Groups), I need to find the list of Zones for which it is in fact a member, and see if User is authorized for any of those Zones
[03:48:42] <caitp> does that explain what the query needs to do, or is that just confusing?
[03:54:09] <brizna> Zones has { Locks: [{}, {}, {}] } as part of it's documents, and you want to query Zones for Zones that have a particular lock in its Locks array?
[04:30:54] <thomasdavis> Gday guys, if upgraded my ruby gems mongo and bson and now it throws an error on my keys with '.' (BSON::InvalidKeyName: key must not contain '.' or '$')
[04:31:12] <thomasdavis> the only problem is I just cannot fix the data because there is a decent amount
[04:31:22] <thomasdavis> does anyone know if I could suppress this error or some solution?
[04:55:39] <crudson> thomasdavis: I'd fix it if you could. Looks like check_keys is forced to true for saving documents.
[05:02:43] <Senor> Have anyone try memcached plugin for mysql?
[05:56:15] <pplcf> how to use "$ifnull" in aggregation?
[05:57:05] <pplcf> I want to provide default value for nullish field
[06:50:09] <SrPx> Hello. What happens if I have to make 2 updates on my database, but my process crashes between the call to the first and the second `set`? Will this leave the db in an invalid state?
[12:08:27] <remonvv> They're just identifiers. It's only dangerous if you expose something in your application that allow other people to do something with that information
[12:09:11] <_pash> i am trying to make a platform like a social network. where each user has a profile picture, i am storing each users image path in the database, part of the path where their image is stored is there id, maybe you could suggest a more efficient way of storing images?
[12:13:33] <remonvv> E.g. if you blindly make a REST service /user/{userId} and you return all data for that user then yes, potentially dangerous
[12:15:23] <_pash> ok i understand, maybe you could answer the second question? remonvv
[12:17:52] <remonvv> _pash, no that sounds reasonable. That's how most people including us do it. E.g. www.yourawesomething.com/users/profile/{userid}/avatar_small.jpg
[14:05:42] <hyperb> I'm using graylog2, which uses mongodb. I had never heard of mongodb before then.
[14:06:09] <hyperb> I need to batch-create a bunch of users with the same profile settings. There's no functionality for it from within Graylog2.
[14:06:32] <hyperb> I did some testing yesterday and I can do it from the mongodb interface and it works fine. I tested importing a .js script and it works.
[14:07:03] <hyperb> So I want to export the list of streams and then run that through a JS for loop to create the users.
[14:07:26] <rspijker> you *could* do that in the js as well
[14:07:46] <rspijker> if you are already loading the js, you can simply put the db.collection.find() in there
[14:07:53] <rspijker> then use the resulting cursor
[14:07:53] <hyperb> I need to manually select which streams though
[14:10:10] <rspijker> point is, you can query the database for some criterium and then use the resulting cursor to do the magic you were planning on the text file
[14:11:01] <hyperb> Right. I realize that. If it were something like 'add all streams beginning with "dev" to this group of users' then yeah.
[14:11:43] <hyperb> I don't have the rights list yet, I was just guessing it was not going to make sense. Based on past experiences with the devs.
[14:11:56] <hyperb> The devs here at work. Not the mongo or graylog devs
[14:15:55] <rspijker> alright, do you have enough of an answer to solve your problem?
[14:16:07] <rspijker> or at least some starting point
[15:00:31] <caitp> http://pastebin.mozilla.org/2640258 how does this make you feel
[15:02:04] <neagix> hi there! I have the classic newbie question (yes, I did some searches already). if I update an object then the next read operation is not guaranteed to fetch the last version of the object, right?
[15:04:26] <_pash> hello, i have a form with an input file field. can i submit the form somehow as soon as the user selects a file?
[15:04:50] <caitp> is that a mongo-related question?
[15:04:59] <Avish> hi all. I have an issue with mongodump (using mongo 2.4): when I dump an entire collection, I get a metadata.json file for each collection that includes its indexes; but I also get a system.indexes.bson which includes the same information. How come?
[15:06:21] <caitp> for file inputs in html, you can bind the onchange event and send an XHR request to the server, if that's what you want to do
[15:06:42] <neagix> caitp: I think it's valid for all NoSQL engines, but can't say for sure. and I only use MongoDB
[15:07:03] <caitp> but it's not really a database question yeah?
[15:07:04] <caitp> that sounds more like generic web dev
[15:07:17] <caitp> oh wait, you asked something else
[15:08:56] <caitp> anyways, I kind of want to hit my colleagues for writing queries like this, someone tell me if it's okay to feel like that http://pastebin.mozilla.org/2640258
[15:45:22] <remonvv> Yes. Imagine something updating the value of the field of the old document between you reading its value and writing it to the new document.
[15:45:49] <remonvv> Mind you that either may not be possible or you might not care in your application (because you can live with eventual consistency on some level) but it's worth thinking about.
[15:46:00] <hyperb> Ah. Yeah, that's not gonna happen.
[16:40:07] <georiot> hey guys, i'm brand new to mongo, and working on updating 30 or so values in a document at a time using the atomic $inc operator. My query to find the document to update is a point lookup (i.e. _id: "username-date") so that part is fast. The values i'm upsert/incrementing however are nested into a couple arrays, so i can pre aggregate this data at the day and hour levels. (i.e., value,
[16:40:07] <georiot> days.value, days.{day}.hours.{hour}.value, country.{country}.value, days.{day}.country.{country}.value, days.{day}.hours.{hour}.country.{country}.value, etc) Do i need indexes on these searches that happen inside a document after its been selected, or does the index only help to find the document in the first place (i.e., the query part of the operation)?
[17:02:03] <idlemichael> I'm using mongo as a key/value store. I'm store ~900 million entries in the database, and am merely checking for their existence. I don't have any indeces, except hte _id index. The database is about 150GB large as listed in the mongo console. I'm trying to xfer this data to a slave, but the slave NEVER catches up to the master. I'm trying to avoid stopping writes to the master due to it being a production box. Am I
[17:35:53] <pasichnyk> whats the recommended way to use a domain name as an array key?
[17:49:07] <LambdaDusk> anyone have an example for GridStore use in node.js with write streams?
[19:18:54] <kevino_> is there a way to have a node mark itself out of a replicaset for maintenance in 2.0.4?
[19:19:02] <kevino_> it seems like the replSetMaintenance admin command isn't available
[20:56:30] <gregie156> is there a way to make map() function's output minimized, like normal find() output?
[21:14:10] <czajkowski> This may be of use to some folks here - http://www.lczajkowski.com/2013/07/16/making-it-simpler-to-get-sponsorship-when-needed-from-10gen/
[21:34:22] <maeldur> anyone have any guidance for what a reasonable pool size for mongos instances in production?
[21:45:33] <cybertoast> the documentation for mongorestore says that if i supply --username without --password i'll be prompted for password. but this does not seem to be the case. is there some order that i need to follow? for example `mongorestore --drop --host localhost --port 27017 --db my_db --username admin_user /path/to/dump/` does not work, but adding `--password my_password` does
[21:47:10] <cybertoast> i instead just get … assertion: 18 { code: 18, ok: 0.0, errmsg: "auth fails" }
[21:57:21] <gregie156> anyone know how i can use $where from php?
[22:37:35] <vaq> Hello, I have configured 3 servers in a replicaset, how do I protect myself if two of those machines are down? To my knowledge I cannot ellect a new primary if only one server is left?
[22:43:47] <dan__t> I'm trying to automagically set up replication, but I want to do so in a way that would allow for two of the three nodes to not be operating at the time that replication was initialized on node01. Can I do this?
[22:48:21] <dan__t> ah I had a typo.... needed something like cfg = { ...
[22:50:46] <dan__t> either way, my json file doesn't do what i expect it to. i wnated replica config there ready to go while two of my three nodes still have yet to come up
[22:54:43] <vaq> Hello, I have configured 3 servers in a replicaset, how do I protect myself if two of those machines are down? To my knowledge I cannot ellect a new primary if only one server is left?