[08:43:26] <acron^> hello, I am writing a custom aggregation pipeline operator and am looking for a little guidance on resolving $field references in queries, a la $project
[08:44:30] <acron^> I already have the operator 'registered', was just hoping for a direction for resolving that part of the query, as the code to do this already exists somewhere :)
[08:44:56] <Derick> you mean patching the mongod source?
[10:28:35] <abonilla> hi - is there a way to enable replication/sharding from within the mongodb.conf file instead of configuring from within the mongo shell?
[11:48:34] <IrishGringo> is anyone doing the 10Gen Java class online?
[11:48:35] <IrishGringo> I am trying to get MongoClient to load in a project using inteliJ and Maven... but I am new to java and mongo
[11:48:51] <Donatello> Hi everyone, i'm trying to activate the authentification whith mongodb on Sharded cluster (2 ReplicaSet), but i'm having an issue so i have a question does i have to set the option --auth and --keyfile ? or just --keyfile option? and does i have to set the option on every members o of my cluster or juste on each configServers ? Can someone Help me :) ?
[12:18:03] <IrishGringo> good morning, anyone here?
[12:22:57] <Donatello> Hi everyone, i'm trying to activate the authentification whith mongodb on Sharded cluster (2 ReplicaSet), but i'm having an issue so i have a question does i have to set the option --auth and --keyfile ? or just --keyfile option? and does i have to set the option on every members o of my cluster or juste on each configServers ? Can someone Help me :) ?
[12:45:17] <IrishGringo> I am new to java, and doing the 10Gen MongoDB course... but I am having trouble... I am trying to add a mongoClient maven repository... and I can not figure the routine out... could someone give me a hand on how to do this please
[12:46:00] <cheeser> why would you need a new maven repository?
[12:46:05] <cheeser> the driver jars are in central.
[12:46:21] <cheeser> you should just need to add those entries to your pom and be set.
[12:47:52] <IrishGringo> really... that is all there is to it?
[12:53:15] <IrishGringo> I am starting from a command line program... and I am trying to do the HW for 10Gen U... are you familiar with the HomeWork ( due today)?
[12:53:43] <IrishGringo> If you could just help me with the start, I am certain I can figure the coding out with out trouble.
[12:53:44] <cheeser> i'm not. i haven't done that course.
[13:13:53] <cheeser> as i understand, those field names come from earlier stages
[13:14:03] <acron^> Obviously the code to replace this with a document field value already exists, I just need some one to point me in the right direction
[13:14:09] <cheeser> if $project is first, then those field names come from document properties in the collection
[13:14:45] <acron^> When the query arrives at my operator, it has not been replaced...and I am only passed a document
[13:14:58] <acron^> So I imaged there was some smooshing together of query and document I needed to do
[13:16:18] <cheeser> i don't understand what the problem is... are you trying to do string manipulation before you pass that string to mongo?
[13:18:32] <acron^> so, in code, I have my query and I have my document but I want to resolve that query so it reflects the field value of '$entry_id' as it appears in the current document I am processing
[14:20:33] <Nomikos> (where p is our products collection)
[14:21:23] <Nomikos> .. I think quoting the field name works.
[14:24:23] <cheeser> yeah, you'll need to wrap that property name in quotes
[14:26:51] <Nomikos> sometimes you have to bang your head against the desk for 15 minutes, try everything, and finally throw the question out into irc - before then, 20 seconds later, suddenly realizing the answer.
[17:24:32] <swulf--> What might cause this error? pymongo.errors.OperationFailure: command SON([('findAndModify', 'counters'), ('query', {'_id': 'myseq'}), ('update', {'$inc': {'seq': 1}})]) failed: no such cmd
[17:24:48] <swulf--> I'm using pymongodb's collection.find_and_modify() func
[17:25:06] <swulf--> would I get 'no such cmd' if the find query fails?
[17:28:43] <cesarkawakami> swulf--: you're trying to modify a document's _id? You can't do that.
[17:35:13] <rhalff> Hi I'm using _id inside my application code, if I send an update back to the server, should I first add _id: ObjectId(obj._id) to the incoming json before I save it?
[17:35:28] <rhalff> I don't like it, but I don't wanna change my application code for nw.
[17:36:09] <rhalff> cesarkawakami, yeah, like a post or put in json
[17:36:25] <rhalff> I wanna save it back to the database, a put contains the the _id
[17:36:42] <kali> rhalff: that would make it work, but... it's quite dangerous
[17:37:26] <rhalff> kali, but I don't understand, how should I normally fetch a document? I should add an id property and when I use find, I should make sure I do not send the _id out?
[17:38:02] <rhalff> for me that _id thing is a little irritating :-) Now everywhere I must take that _id into account. It's there but I should not use it
[17:38:41] <swulf--> cool, it works now, thanks for you guys' help!
[17:38:44] <kali> rhalff: you don't have to use ObjectId as _id. use string or int if that makes your life easier
[17:39:31] <rhalff> kali, ok as quick fix I'll just use ObjectId before update then, later I'll redesign :) thanks
[17:41:43] <cesarkawakami> rhalff: the "feature" of ObjectId is that it's a reasonaly reliable distributed way of generating unique, more-or-less sequential ids
[17:42:16] <cesarkawakami> rhalff: just encapsulating another id as an ObjectID defeats the purpose. Better just to use your id directly.
[17:44:06] <rhalff> cesarkawakami, ok, right now my only unique id is the _id
[17:44:26] <rhalff> I guess I should make slugs or something to be the unique id.
[17:45:49] <cesarkawakami> rhalff: you can put them into _id if you want. _ids don't necessarily have to be ObjectIds. But, then again, experience has shown me that natural primary keys (as opposed to artificial ones) are to be avoided in a general sense.
[17:46:32] <rhalff> cesarkawakami, I won't mind keeping it, but then I would have to filter out _id before I send it to the client?
[17:47:32] <rhalff> or as a rule of thumb specify exactly what kind of fields I want to be returned.
[17:48:04] <cesarkawakami> rhalff: well, the _id is your "primary key", and getting your primary key back is usually a good thing
[17:49:08] <cesarkawakami> rhalff: sending it to the client doesn't sound like a bad idea to me, also. The only thing is that objectids are usually not directly serializable; you'd have to find out a way to serialize them (and usually you'd want that to be reversible)
[17:49:10] <rhalff> cesarkawakami, ok, curious how other people do it. who use ObjectId
[17:51:38] <cesarkawakami> rhalff: the way I do it (not necessarily the best) is to serialize it as {"$oid": "string representation of the objectid"}, because it's a representation mongodb uses in some cases (extended json)
[17:51:47] <rhalff> maybe it would be nice if _id was just something internal, something that would took some work to expose.
[17:53:15] <cesarkawakami> rhalff: you want to make your "primary key" hard to expose?
[17:53:16] <rhalff> cesarkawakami, my major bug was, that the client sends back the string representation, so I ended up with new records instead of updates, because they where not objectIds
[17:54:14] <cesarkawakami> rhalff: that's because your client-server protocol is wrong.
[17:54:15] <rhalff> cesarkawakami, no start with my own 'id', and have mongodb internally always have an _id of their own.
[17:55:23] <cesarkawakami> rhalff: that wastes space and processing time. But on the other hand, the _id field could be "renamable".
[17:56:18] <rhalff> cesarkawakami, what is wrong in my protocol.
[17:59:02] <cesarkawakami> rhalff: your json library probably isn't carelessly serializing objectids as strings. You probably explicitly made it do it. When you did that, you established a protocol to convert between the server internal representation (which has object ids) and something that's json serializable. But you probably forgot to do the reverse, which broke your protocol because then x != decode(encode(x))
[18:00:26] <cesarkawakami> rhalff: you should probably encapsulate the protocol logic somewhere so that (1) there's one true source for the protoco language and (2) you don't forget any aspect of the protocol when you use it.
[18:00:52] <cesarkawakami> rhalff: also, unit tests.
[18:01:00] <rhalff> I think it probably calls ObjectId().toString() which string concatenation already does automatically. so no magic there I think.
[18:01:14] <cesarkawakami> rhalff: which language is your server in?
[18:43:33] <dllama> quick question, i'm trying to clean up my db to improve performance, was storing html/css as sepearate fields in the db with each document being a combined total of about 70-180kb. after hitting approximately 40k documents, i'm noticing huge delays. so in an attempt to clean that up, i'm completely removing those items from the db. its a rails app so in a local env i just did an each loop that sets those fields as "". yet my db
[18:44:41] <dxd828_> I have a question, on my single server mongodb install I have a single node connection and the mms stats+backup agent connecting. On the DB stats it shows about 988 connections, which seems high. After a few hours I can no longer open a new connection to the server. Any ideas? Nothing interesting in the logs :/
[18:46:11] <cesarkawakami> dxd828_: that seems high. I have mms stats (no backup) and a replicaset cluster with >100 clients connected, and my number of connections hovers around 160
[18:47:03] <dxd828_> cesarkawakami, yeah I thought so. My nodejs app only opens a single connection as far as I know so I don't know whats causing it :/
[18:53:12] <samholmes> dxd828: I didn't specify a config file
[18:54:04] <dxd828> samholmes so you're trying to start it without a config file?
[18:54:21] <samholmes> I'm running it just with `mongod`
[18:55:01] <samholmes> I don't have a config file. Isn't there a way to run it with default config?
[18:57:00] <samholmes> dxd828: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/ this doesn't mention anything about a config file
[18:58:38] <samholmes> dxd828: it does say something about it under "Use MongoDB from Official Builds" but I'm using homebrew
[18:59:18] <dxd828> samholmes: so what are you typing into the terminal to start mongod?
[19:24:14] <kostil> hi all, have a question. joined a small company which uses mongodb with node, but all schema names are minified (ex. u1 instead of userId). I want to be able to use mongo console client while someone transforming the queries for find() and update() from normal to minified names based on config for each schema. is it possible to use mongo shell scripting to achive this and keep the interactive console?
[20:36:56] <cowstrike> Hi, I've got a question regarding memory usage when iterating over a cursor using pymongo. For some reason the memory balloons. This is the output from memory_profiler:
[20:37:57] <cowstrike> The documents that are returned are small. This profile is made when limiting the cursor for 30,000 objects
[20:39:55] <joannac> Yay, 2.4.7 has the fix for server-11032 !
[22:13:59] <vl4kn0> Hi, I have Nx16 array whose values are in range 0 - 255. Is there any way I could use mongo search facility to search in those arrays?
[22:14:35] <vl4kn0> the point here is that I probably cannot fit values up to 255 in a simple text
[22:32:36] <ginhinio> does mongo work on windows xp
[23:17:37] <joannac> It does not return the array element(s) that are removed
[23:18:20] <snkcld> ah, so if i essentially want to toggle a value in an array, i would find() on the document, then check via javascript, and add or remove appropriately from there?
[23:18:53] <joannac> Um, what do you mean by toggle?
[23:21:38] <ginhinio> guys why doest mongo work on my windows xp pc
[23:21:47] <snkcld> well, i have a bunch of buttons with different values, and when they click on the button, it adds that buttons id to an array, but if its already in the array, then it removes it
[23:24:52] <snkcld> $pull just kinda sounds to me like, returning. as opposed to for example, a $remove
[23:25:15] <joannac> snkcld: $pull is going to give you grief if your arrays get large
[23:25:58] <snkcld> ah, rats... so its best to avoid it? then how would one save an array of data, like favorite_artists, and remove/add, without using $pull?
[23:26:58] <snkcld> joannac, it will give grief as far as performance?
[23:28:06] <snkcld> also, if you look at the third line, does adding "favorite_artists: []" to the findOne ensure that there is a favorite_artists field in what is found?
[23:28:55] <joannac> use $exists if you want to ensure a field exists