[00:56:46] <sharondio> Hi all…anybody around? Just need to confirm that our schema isn't going to work before going through the trouble of changing it.
[02:50:15] <leekaiwei> hi guys, i'm getting the error class 'mongoclient' not found. i've scoured the internet, updated things and edited php.ini but still not working. doesn't really warrant a pastebin but here it is http://pastebin.com/kpDLyFuC
[03:13:10] <ranman> leekaiwei: I think that probably means you don't have the library installed correctly ?
[03:13:39] <leekaiwei> i've already ran sudo pecl install mongo
[07:39:02] <Nodex> you can probably do a find() and search for reference type
[07:39:56] <jbackus> Hey everyone. my friend and I are trying to figure out if MongoDB would be the right way to solve a database problem in our application. Would you all mind if I gave you a few sentence description of the problem so I can get your input(s) on whether Mongo would be the right way to go?
[07:40:10] <Nodex> referencing Authors in books is also not the greatest idea .... how often does an authors name change?
[07:40:29] <Nodex> jbackus : just ask the question is usualy best
[07:41:21] <jbackus> Yeah I thought so, just wanted to check since I sometimes join programming IRC channels and somehow get yelled at in the first minute
[07:41:22] <rbento> Nodex This was just a silly example
[07:49:40] <jbackus> so our product is designed so that companies can verify customer identities. The verification criteria differs depending on the type of customer (i.e. U.S. Citizen vs. Non-U.S.). Some verification variables have multiple components (address->street,city,etc), some verification methods can be done one of many ways (identity through SSN, TIN, or License), and if a customer updates a variable (like address) we want to track the revision history for that.
[07:49:53] <jbackus> So basically the model in question (call it CustomerVerification) doesn't have any constant keys, some of the verification variables have multiple components (like a python dictionary), and some variables only need one verification for a array of options to pass. Does this sound right for Mongo to you guys?
[07:50:22] <jbackus> (My friend thinks Single table inheritance or multi table inheritance is the way to go)
[07:50:55] <puppeh> I have a collection which has a hash field
[07:51:51] <puppeh> and I want to update a document by inserting some key-value pairs into that hash field
[07:57:06] <Nodex> jbackus : I use mongo for everything from Job boards to CRM, CMS and Social networks. There is nothing I cannot make it do - admittedly sometimes wiht the help of external tools but mongo IS my primary data store
[07:59:13] <jbackus> Haha ok so a tiny bit biased :P
[08:00:07] <Nodex> not at all, I believe in the right tool for the job
[08:00:35] <Nodex> why use relational when you dont need to and why use non relational when you dont need to :)
[08:00:37] <jbackus> Alright, I'll probably stick around for a bit as I think I'll try and port some of my SQL join-insanity to Mongo and see how it feels
[10:00:49] <remonvv> Well, with the possible exception of error messages like "Gee, something went wrong here. Let me explain. Back in the day when Is started this project there was a null check here but I removed it hence this NullPointerException. Sorry."
[11:40:42] <merpnderp> I just moved my dev to my local mac to use webstorm, but just realized I'll need to run mongo locally. I really don't want to do that. Has anyone had luck using mongo through an ssh tunnel?
[11:46:28] <rspijker> merpnderp: I haven't tried but I see absolutely no reason why it shouldn't work
[11:49:05] <Avish> Hey guys, anyone who knows about the C# driver around?
[11:49:54] <merpnderp> rspijker: using the same -L ssh flag that works for mysql I'm getting a can't connect error on 27017….bizarre
[11:50:14] <Avish> I'm trying to use Aggregation Framework from C#. I know LINQ support for it is not yet ready but I'd like to use something similar to Query<T> and the other builders to be able to use MemberExpressions on my document type instead of hard-coded strings.
[11:51:23] <rspijker> merpnderp: let me give it a go real quick :)
[11:52:35] <Avish> e.g. I want to do something like collection.Aggregate(Match<T>.Eq(x => x.SomeProperty, "someValue"), Group<T>.By(x => x.GroupProp).Value("count", Group<T>.Sum(x => 1))
[11:53:34] <Avish> Or even simpler, I'd like a simple way to translate a member expression like `x => x.SomeProperty.SomeInnerProp` to its named equivalent `someProperty.someInnerProp` using the mapping defined on T. Then I'll build the aggregation operator docs from that. Is this possible?
[11:54:10] <rspijker> merpnderp: works like a charm here...
[11:54:41] <rspijker> merpnderp: could it be that your ports are firewalled on the mongo host?
[11:55:45] <merpnderp> rspijker: I'm sshing in to the mongo host so connecting to 127.0.0.1:27017 should just be tunneled to mongohost:27017. Shouldn't it look like a localhost connection?
[11:56:34] <Avish> Basically, I want to do what QueryBuilder<T>.EQ does when it translates the expression to an element name. Anyone>
[13:12:13] <rspijker> sorted the primary move remonvv ?
[13:12:50] <remonvv> Nope. It ended up in a state that wouldn't allow it. Didn't have time to figure out why but I'm assuming an ill-timed mongos restart or something.
[13:18:24] <rspijker> Derick: I completely agree that it should not be done, just trying to explain to this "dude" why it could happen :)
[13:18:27] <remonvv> spaces in your fieldnames are a nightmare
[13:18:43] <shmoon> sorry about it. actually I can add, but not update when field has '.'
[13:19:16] <remonvv> shmoon, that's because the query validation is somewhat inconsistent between the "criteria" and "update" parameters of the update operation.
[13:19:26] <remonvv> In any case, possible or no. Just fix it properly and remove the period.
[13:21:13] <remonvv> If you want my advice; all fieldnames should be predictably cased (lower, camel, etc. but be consistent) and have no spaces or other non alphanumeric characters.
[13:21:14] <shmoon> using name.middle you can set middle key inside name sub document
[13:21:43] <remonvv> Righto. That's why it's not allowed and why you shouldn't get a period in there even if your driver/import allows it.
[13:21:58] <shmoon> but i am kind of solving a complex problem and needed to have the app up asap, basically all field names are defined by the user (comes from html form)
[13:22:08] <shmoon> in a subcoument (embedded document) inside main documents
[13:22:39] <remonvv> shmoon, I understand but you'll never be able to get this schema to work. Your user input -> field name conversion should convert it to something that follows the rules mentioned above.
[13:23:32] <remonvv> And frankly allowing end users to determine your field names is on the dodgy end of things as well. You should probably go for a (field:"No. of pages", value:"64"} sort of schema then
[13:23:33] <shmoon> actually lets discuss this a bit, maybe i can find another way to solve my problem (requirement) - 1 sec
[13:23:39] <remonvv> Because yay indexes and all that.
[13:24:56] <remonvv> So, good luck cowabunga-ing your way out of that one ;)
[13:25:33] <shmoon> remonvv: so I have tables like this http://puu.sh/3FRz9.png - user can put in keys (top row) and then values, add rows/columns. I want to save it in a proper way and then be able to properly search later and do further operations like filter/comparison, etc. stuff. such tables belong to each product, and each product can have multiple such tables
[13:26:16] <remonvv> Right, so see my schema suggestion above ;)
[13:26:25] <remonvv> Which is indexable (word?) and searchable
[13:26:35] <Derick> shmoon: those are values for something, not keys. Keys should never be arbitrary (as they are now,as the user can use whatever they want)
[16:08:03] <novice35> Hi all, I am new to mongodb and I tried to follow the tutorial "http://docs.mongodb.org/manual/tutorial/deploy-replica-set/" but when I tired to execute the command rs.add("vm_name") the following error occured : "exception: set name does not match the set name host vm_name:27017 expects
[16:08:40] <novice35> please can someone help me to figure out the origin of the problem
[16:20:30] <novice35> can someone help me please ?
[16:31:59] <remonvv> Assuming vm_name is your actual hostname
[16:44:43] <FuZion755> hi all, i'm trying to reformat a date within an aggregate... when I try to concat the different component it yells at me because some of them are integers.. is there a way to cast integers to strings? I can't for the life of me find any way to do that in an aggregate
[17:00:19] <Chrishas> hi, the following gives me an error about argument 5: mongo_create_index(conn, "testdb.Users", key, 0, out);
[17:01:00] <Chrishas> although it's the same as the C Mongodb api tutorial, and it also complains about too few arguments
[17:06:10] <Chrishas> algernon: which is the alternative c driver?
[17:26:57] <JeremyKendall> I have a question about updating multiple mongo collections in the same js file if anyone has a minute
[17:27:49] <Guest5537> I need to construct a query that only matches documents that have an array field whose first element in the array matches X. Is it possible to do positional stuff like this with queries?
[17:28:01] <sharondio> JeremyKendall: What do you mean the "same js file"?
[17:29:01] <JeremyKendall> I have a js file with multiple commands. I run it like 'mongo dbname file.js'
[17:30:56] <Chrishas> algernon: thx but the system I'm trying to run it on has an older version of automake tools and autoreconf shows an error, is there another way to compile this?
[17:31:10] <kali> JeremyKendall: http://docs.mongodb.org/manual/core/server-side-javascript/#running-js-scripts-in-mongo-on-mongod-host maybe that will help
[17:31:55] <sharondio> Guest5537: It is possible to do positional stuff in arrays when you know the index of the item you're looking for.
[17:32:15] <JeremyKendall> kal1: Thanks for the link. I'm not actually having an issue running the js files. My problem is with the commands *in* the files :-)
[17:32:39] <sharondio> Guest5537: If you don't know the item, you can do it with $ variables, but only one level deep. No arrays in arrays. #askmehowIknow
[17:33:05] <kali> JeremyKendall: well, you need to be more specific, then
[17:33:27] <algernon> Chrishas: you can run autoreconf -i on a newer system, copy the results over and compile away.
[17:34:23] <JeremyKendall> Here's the file: http://pastie.org/private/27g3umsrxvbymyni6xaata When I run it via the command line, the remove() works as expected, and so does the first update(). The rest of the commands don't seem to run.
[17:34:41] <JeremyKendall> If I run the file again, the second update() runs, but again the rest of them don't seem to run.
[17:35:35] <JeremyKendall> (I'm basing "don't seem to run" on the results of counting the collections to see if the fields I unset are actually unset)
[17:35:35] <kali> JeremyKendall: can you try with $unset : { <blah>: true } instead of these empty strings ?
[17:36:23] <kali> JeremyKendall: and show me the count queries you run to check too
[17:36:31] <JeremyKendall> kal1: Will do. I'll ping you once I try that.
[17:36:49] <Guest5537> sharondio: I do know the index I'm interested in. Is it as simple as doing a regular query with the first part of the array? {'array[0].field': {$eq: 'value'}}
[17:36:50] <JeremyKendall> kal1: Grabbing the count queries now . . .
[17:37:34] <sharondio> JeremyKendall: Is it possible you have an asynchronous issue? I'm still pretty new to server-side stuff, but finding async.js has changed my life.
[17:38:02] <JeremyKendall> sharondio: That's entirely possible, but I woulnd't know how to diagnose that.
[17:38:29] <sharondio> Guest5537: http://docs.mongodb.org/manual/core/update/#update-arrays The first code example seems to support that, but I haven't tried it.
[17:39:32] <sharondio> JeremyKendall: Well, when I find myself bashing my head against the wall with JS not behaving like I expect, I've learned to suspect Asynchronous processes. It's also nice to have async.js just be able to tell me when everything has processed, or run an error function if something is misbehaving.
[17:39:58] <jmar777> the mongo shell is synchronous
[17:40:06] <jmar777> (including when its scripted)
[17:40:08] <sharondio> JeremyKendall: The way your stuff is laid out, there is no error capture at all so you wouldn't even know if something were bombing.
[17:40:35] <JeremyKendall> kal1: Here are the counts I'm running http://pastie.org/private/kaoys9qe927i0oejhqina I snipped two of them because they're pretty much all the same
[17:40:45] <JeremyKendall> sharondio: How would you recommend laying out those commands?
[17:40:47] <sharondio> Sorry, you are doing try/catch. So that should catch it. Hmmm
[17:48:59] <sharondio> kali: Even synchronously, one of these calls is stopping everything. It might help to see which ones are actually finishing. Is there some kind of command to make the shell more verbose? I only do test queries in the shell. I do everything else in node (obviously).
[17:49:41] <kali> JeremyKendall: add print statements after each op to see if it's running till the end
[17:51:27] <sharondio> JeremyKendall: Check this out: http://stackoverflow.com/questions/9457368/inserting-data-to-mongodb-no-error-no-insert
[17:52:01] <sharondio> It's possible the updates are error-ing and not firing off an error.
[18:04:26] <JeremyKendall> kal1: I added print statements after all of the updates. It made it to each of them, but the script behaves the same as before.
[18:07:51] <kali> JeremyKendall: yeah. i'm not surprised
[18:08:11] <kali> JeremyKendall: can you show me what you do in the interactive session that does work ?
[18:08:31] <JeremyKendall> I simply copy and paste each command. Nothing special.
[18:10:07] <kali> JeremyKendall: can you add a print(db.c1.count()); at the top of you file, to check if we are really working on the right db ?
[18:11:35] <JeremyKendall> kal1: OK, this is weird. I added printjson(db.runCommand({ getLastError: 1, w: 1, wtimeout: 5000 })); at the bottom of the script (inside the try) and it worked the first time through.
[18:11:56] <JeremyKendall> Everything got deleted just as I expected it to originally.
[18:14:06] <kali> i'm confused about what's synchronous and what is not in the shell
[18:14:21] <kali> it may also have changed between 2.0 and 2.4
[18:14:36] <JeremyKendall> True. I certainly don't know.
[18:15:36] <JeremyKendall> I'm adding that getLastError after each command just to see what happenes. I'll let you know.
[18:18:01] <JeremyKendall> kal1 && sharondio: Added getLastError after each command, got no errors from any of the commands, and everything worked as expected.
[18:18:57] <JeremyKendall> Without those checks, the script runs in milliseconds. If it were actually doing the work, it would take much longer (there's a lot to delete).
[18:19:09] <JeremyKendall> That's diagnostic, but I have no idea what it indicates.
[18:21:10] <sharondio> JeremyKendall: I'm not sure leaving in those logs is the real answer, even if it does work.
[18:31:01] <pwelch> so I want to do what I currently do with mysql. I have a master and a slave. when I do a switch over I make a new master and connect it to the old slave to update the data
[18:31:18] <pwelch> I think point my app servers to the new master (that is connected to the slave)
[18:31:48] <pwelch> can I start a mongodb instance as a master and slave so I can just point to the box?
[18:34:52] <JeremyKendall> kali && sharondio: Wild goose chase. Turns out those commands were all running. It takes 10-ish seconds for them all to finish. The js file was just queuing them up. I was counting too quickly.
[18:35:10] <JeremyKendall> This time I waited about 15 secs, ran my count script, and everything that should have been zeroed out was.
[18:35:29] <Gargoyle> pwelch: The mongo driver takes care of failover.
[18:35:55] <pwelch> for replica sets correct? Im talking about master/slave replication
[18:36:43] <Gargoyle> pwelch: Not sure what mongodb master/slave is if you are not talking about a RS.
[18:37:33] <pwelch> same as MySQL master/slave. read/writes go to master and they get sent to the slave. You can "promote" the slave by pointing the writes to it
[18:38:34] <Gargoyle> Didn't know it did that. been out of the loop since Feb.
[18:39:30] <pwelch> form the docs mongodb master/slave is deprecated. Im trying to use it for when I build new nodes and need to point to the new one
[18:39:43] <pwelch> I dont need 3 mongo nodes running
[18:40:03] <pwelch> just one. however, I want to chain them to keep the new one updated and then swap it out
[18:40:40] <eka> hi all, mongo is crashing with this message "warning: DR102 too much data written uncommitted 315.318MB" my setup is 4 mongodb in shard with 3 configs… it was running for a very long time, today started doing this
[18:41:54] <Gargoyle> pwelch: I'd use the replica set instead of depreciated stuff. Just run an additional mongos process on one box as an arbitrator.
[18:42:25] <pwelch> Gargoyle: then I would have to force the one I want to become primary correct?
[18:42:54] <pwelch> and I would have to reboot my apps so the client lib (driver) knows about the new node
[18:42:58] <Gargoyle> pwelch: You just step down the Primary - the secondary will take over within a few seconds.
[18:43:09] <sharondio> JeremyKendall: It happens. I learned a new shell command out of it, so that's cool. :-)
[18:43:11] <Gargoyle> pwelch: Don't think you have to reboot.
[18:43:26] <pwelch> doesnt the applications mongo driver know about all of the nodes?
[18:43:41] <pwelch> if I add one then I have to add it to the config and reload/restart the app
[18:43:45] <JeremyKendall> sharondio: :-) Thanks for your help. You too, kali
[18:45:11] <Gargoyle> pwelch: Yeah, you can add more than one node address to your connection params. to make connecting easier when you don't know which is the master from a "cold start", but the client should also be able to figure out the other nodes once it has connected to one.
[18:47:03] <pwelch> Gargoyle: sorry, I dont fully understand how the client lib knows about all nodes. does it connect to the one you give it and then pull in info about the entire cluster?
[18:47:47] <pwelch> if I add 3 more nodes but only told the client app about a single IP/FQDN it queries the info from that single node and learns about the others?
[18:48:22] <Gargoyle> Obviously, if the node you have configured is down when the app starts, it fails. So I think you would normally specify 2 or 3 in your connection params, and let the rest be discovered.
[18:49:01] <Gargoyle> pwelch: Set up some VMs and have a play.
[18:49:40] <pwelch> Gargoyle: ok, I will. Was trying to get some info to deploy a solution today but this helps. thx
[18:52:51] <artdaw> hi guys, I need help in mongodb production setup
[18:53:55] <artdaw> I already have mongodb in prod but today it slows down completely and I'm really in stuck
[19:17:02] <Ontological> So, am I not allowed to use the collection name of 'auth'? If not, where might I find a list of all such reserved names?
[19:29:32] <leander> Hi. When exactly the primary of a replication set becomes unavailable? For example if a sector of a harddisk becomes corrupt, mongodb will make the machine unavailable?
[19:59:58] <kevino> anyone know when the replSetMaintenance command was added?
[20:36:13] <alexr2> i'm trying to remove all items from an array of objects (product_limits) using an array of ids... any suggestion on how to get this working? -- something like $pullAll: {"product_limits._id": id_array}
[20:37:18] <kevino> eka: no, everything is working fine otherwise. all of my clients from the web servers connect without a problem
[20:37:26] <kevino> i'm just trying to run utility scripts from my machine
[20:37:45] <eka> kevino: did you try writing to the mailing list? now it seems like lunch time