[00:46:40] <hoverbear> How can I atomically push to an array inside an array in Mongo?
[00:51:42] <tomas> hi I'm very new to nosql world, can anyone please tell me what is the proper way of referencing to linked document from the document I've queried? For example I've got: http://pastebin.com/ARzsTd7A
[00:52:16] <tomas> how do I get my note author from my note?
[00:55:50] <joannac> hoverbear: do you know the index of the first array?
[01:29:05] <hoverbear> joannac: I'm basically having a data race issue, I need some way of detecting when my values are stale.
[01:29:20] <hoverbear> joannac: I want to use the atomic updates.
[01:29:46] <hoverbear> Instead of get data, edit data, save data.
[03:41:32] <l_s> after importing a csv file using mongoimport, any operations i do with the collection will return a syntax error, even with db.collection.drop(). what could be the problem?
[03:45:13] <l_s> the exact message is SyntaxError: Unexpected token Illegal
[03:54:16] <l_s> i am reading the doc, to see if there is an privilege thing i have to setup
[03:54:58] <joannac> I'd say it's more likely to be something like this http://stackoverflow.com/questions/12719859/syntaxerror-unexpected-token-illegal
[03:58:47] <l_s> joannac, it really looks like it, I have many characters like @ and # in my csv
[04:07:06] <joannac> did the mongoimport complete successfully?
[04:22:32] <hoverbear> joannac: I can't find any mention of a $pos operator. Is there a way to make it check each item in the array?
[04:30:21] <joannac> hoverbear: a normal search does anyway?
[04:30:30] <hoverbear> joannac: Oh, that might work then.
[04:31:07] <joannac> I'm not sure if that's still true for arrays inside arrays
[04:37:40] <hoverbear> joannac: Normal search works, now I need to push onto the nested array. :S
[05:34:59] <hoverbear> Ugh, "mod on _id is not allowed"
[10:53:40] <abishekk92> Hi, one of our secondaries stopped playing the oplogs, as the disk space was maxed out. So I add more space in the partition containing the data directory, and I check db.printReplicationSlaveInfo on the Primary and ot says it was synced 1 sec ago, however, the new data doesn't appear on the secondary. Any idea why this is happening?
[10:54:16] <abishekk92> Should not the secondary replay the oplogs?
[11:06:39] <csrgxtu> hi, i am using Java query mongodb, and how can i get a filed value
[11:07:11] <csrgxtu> i mean, when i use DBCursor find method, it returns a DBCursor object
[11:16:51] <csrgxtu> and this object contains Username, Password, how can i retrive the Username directly
[11:17:14] <smargareto> should I post my question directly here?
[11:17:44] <kali> csrgxtu: DBObject extends BSONObject, so its get("Username"). see http://api.mongodb.org/java/2.6/org/bson/BSONObject.html#get(java.lang.String)
[11:18:04] <kali> smargareto: yes, skip the meta question and jump to the question :)
[11:31:47] <Gr1> I was setting up mongodb with replication and sharding enabled
[11:32:12] <Gr1> and I got a message that replication should not be enabled on a config server when I try to start the daemon as mongod --configsvr --dbpath /var/lib/mongodb/ --port 27019 --config /etc/mongodb.conf
[11:32:41] <Gr1> Does this mean that the config server would hold only meta data and not the actual db data?
[11:35:24] <kali> Gr1: and even if your three config server "mirror" each other, they are not a replica set, it's a totally different protocol
[11:36:30] <kali> Gr1: so your typical sharding setup should have 3 config servers somewhere, at least one 3-node replica set somewhere else (even if two or more makes more sense), and some mongos somewhere else
[11:36:30] <Gr1> Thank you Kali. I see. So if I am setting up an environment where I need data replication, and sharding, what all services should I run?
[11:41:23] <Diplomat> stupid PHP thinks everything is string -.-
[11:41:50] <Derick> to me it says you don't understand it well enough yet
[11:42:00] <Nodex> pretty sure I've mentioed 4 times now to cast everything in and out
[11:42:09] <Derick> Diplomat: did you read the URL that I posted yesterday?
[11:42:27] <Diplomat> Derick, I do understand , but I'm not used to cast everything
[11:42:53] <Diplomat> I usually use PDO where I use prepare
[11:43:16] <Derick> Diplomat: can you please read: http://derickrethans.nl/mongodb-type-juggling.html
[11:44:44] <Diplomat> yeah i know everything that's written there, but i just forget :D
[11:46:15] <ajph> is it possible to group by regexp in an aggregation query? for example, $group: { "test": { "$sum": { "$regexp": "^a" } } }
[11:47:50] <kali> ajph: i doubt this $group will produce anything interesting even if it valid. can you show us an example document and explain what you're trying to do ?
[11:51:44] <ajph> kali: i'm looking to sum all fields that begin with "a" : http://pastie.org/8911174
[11:51:47] <smargareto> The dictionaries that accumulate the data are flushed to mongo each 5000 lines
[11:52:11] <Nodex> ajph : can't you just $match them in the first pipeline?
[11:52:20] <smargareto> and they are processed in the reverse order of the log (WebAccumulationCategory..WebNavigationUri)
[11:53:01] <kali> smargareto: what should start by "a" ? the field name or the value ?
[11:53:17] <ajph> Nodex: hmm, now i see the problem with not posting an exact use-case. i can't, no. let me get a better example
[11:55:53] <kali> ajph: you should consider changing your schema, actually. if you have to reason on key fields, many different things in mongo will get in the way
[11:57:30] <ajph> kali: really i'm looking to sum all fields that have the format test.(.*).clicks where (.*) is unknown. i don't use arrays because i need to upsert.
[11:57:49] <ajph> i suspect i'll need to make sure my (.*) is known somehow
[12:07:17] <kali> ajph: yeah, if you know the values beforehand, you can write the sum by hand
[12:41:56] <Gr1> If I have config server and mongod instances running on the same server with different port, which one should I connect to, to make a query?
[12:42:09] <Gr1> config server or the mongod instance?
[12:43:32] <Gr1> Derick: Please correct me if I am wrong, but I seems to be able to connect to mongos only when I start the config server. So isn't mongos the config server instance?
[13:03:53] <amitprakash> Hi, is there a good way to combine two update queries in mongo?
[13:04:28] <amitprakash> for example combine two of db[collection].update(filter_criteria, update_dict)
[13:05:37] <amitprakash> the issue is with combining update_dicts, the first update_dict could be {'$addToSet': {'key': value}} and the second update_dict would be {'$addToSet': {'key_alt': value_alt}}
[13:14:35] <amitprakash> Something like db.collection.update({'$and': [filter1, filter2]}, {'$and': [update1, update2]})
[13:21:43] <Nodex> you can use multiple addToSet's in one query as long as they don't change or attempt to change the same value
[13:29:53] <muraliv> hi. is there a way to hard-code a key in map-reduce emit function? in a composite keys situation.
[13:30:03] <muraliv> hi. is there a way to hard-code a key in map-reduce emit function? in a composite keys situation.
[14:04:36] <Sidd> I am having trouble with connection string, or so I think. I wrote a test application that works with connecting to my mongod instances, but I am trying to test connecting to my Mongos instance. I have sharding and replication set up. Everything appears to be working fine.
[14:04:43] <Gr1> Is that something I should worry about?
[14:05:05] <Sidd> I am using the official C# driver, the message I get is "{"Unable to connect to server nc-dev-api:27018: Configuration system failed to initialize."}"
[14:05:59] <kali> Gr1: it's not supposed to happen. if you see this message, you're just not connected on the primary (or there is a terrible bug, but i doubt it at this stage)
[14:06:53] <Gr1> kali: It just disappeared without any intervention.
[14:07:24] <Gr1> All I did was rs.slaveOk() but this error came a couple of times afterwards. then it disappeared.
[14:14:20] <smargareto> I have posted it in stackoverflow: http://stackoverflow.com/questions/22354246/mongo-upsert-performance-c
[14:16:19] <Sidd> If someone can help me with my issue I would appreciate it, I have been unable to find anything with google searching, I am sure Im not asking the right question, but I posted on stack overflow http://stackoverflow.com/questions/22354298/unable-to-connect-to-mongos-in-mongodb
[14:19:24] <eagen> You want to connect to the mongos host and port, not to one of the shards directly.
[14:23:09] <Sidd> Haha, I don't know why I didn't look at the inner exception sooner. It was having trouble reading the xml from the app data file. I don't think this is the first time this file has messed up on me either.
[14:23:58] <saml> in casbah, is there replicaset client?
[14:24:05] <saml> something like pymongo http://api.mongodb.org/python/current/api/pymongo/mongo_replica_set_client.html
[14:24:17] <saml> or do I need to specify all mongo hosts in mongo uri?
[14:29:31] <saml> we all changed python projects to use MongoReplicaSetClient recently :P
[14:30:06] <saml> http://api.mongodb.org/python/current/api/pymongo/mongo_replica_set_client.html#pymongo.mongo_replica_set_client.MongoReplicaSetClient no mention of deprecation
[14:31:01] <saml> http://api.mongodb.org/c/current/api/annotated.html i don't know how to find MongoClient here
[14:31:17] <kali> saml: well, i don't know about pymongo specifics. my reference would be that http://derickrethans.nl/mongoclient.html and various blog entries/discussions indicating a wish to make all APIs similar
[15:15:14] <jarjar_> I'm having some trouble running my script on nodejs with mongoose... keep having this error when I launch it:
[15:15:16] <jarjar_> TypeError: 'undefined' is not a function (evaluating 'inherits(InsertCommand, BaseCommand)') /var/node/suchmaschine/node_modules/mongoose/node_modules/mongodb/lib/mongodb/commands/insert_command.js:38
[15:26:12] <Derick> there is a C driver in the making
[15:26:28] <Derick> pymongo has an *optional* C-based addition to support faster bson en/decoding
[15:26:28] <saml> Derick, so should i not use MongoReplicaSetClient?
[15:26:52] <Derick> i think pymongo is still odd - so I don't quite know
[15:45:33] <KamZou> Hi, i've a strange comportment in my MongoDB : when i type : show dbs i get 200GB for a specific database. And when i use this db and type a db.mycollection.stats i've 100gb+ difference. Any idea please ?
[17:16:55] <Wil> Hey, I was hoping someone wouldn't mind taking a few minutes and looking over an aggregation pipeline for inefficencies I'm sure exist. Trying to optimize a database that shouldn't be so bogged down with the small amount of traffic it's getting.
[17:18:35] <Wil> The collection itself is just a time-series database where each document is the address, createdAt time, the values at that time. Index on both the address and the date.
[17:23:57] <Wil> This is my first time making use of mongodb. That aggregation pipeline is being used by ~5000 people every 5 minutes to every 24 hours. Depends on the granularity.
[17:24:24] <Wil> But even so, I don't think it's a major bottleneck.
[17:24:47] <Wil> DB is writing to that same collection ~5000/minute.
[17:25:03] <Wil> But, again, I feel like these numbers are extremely slow to be causing such a load.
[17:44:38] <Wil> I'm assuming size doesn't include totalIndexSize
[17:45:54] <Wil> It must not, because apparently my index size is 7.9gb? o.O
[17:47:16] <Wil> Nodex: Without the single address index, even if queries are run without the createdAt field, does it still make use of the compound index?
[18:34:43] <Wil> Nodex: Droping that index didn't help. :-P
[18:35:10] <Wil> Nodex: Then again, it wouldn't. Not enough ram anyways.
[19:26:52] <simpsond> "..... If you were stupid enough to totally ignore durability just to get benchmarks, I suggest you pipe your data to /dev/null. It will be very fast.", love that quote from the transcript
[19:39:42] <rob_1234> hello, I have a question: if I have a collection where the _id is a subdocument, { _id: { first_name: "", last_name: "" } }, can I add a field to this subdocument later (as in: db.collection.update( {}, { $set: { '_id.middle_name': '' } }, { multi: true } ); ) ?
[19:40:10] <ron> afaik, _id fields can't be changed.
[19:40:22] <ron> so you'd have to remove and add the object.
[19:45:17] <jrdn> So, we're using pre-aggregated data and the aggregation framework for our reporting (with pivots).. When we add a lot of data, the browser will crash.. so, with that said, we need pagination.. Does anyone know a good place to start for paginating aggregation framework queries effectively?
[20:27:30] <samgranger> Hey Mongo guys - I'm fairly new with Mongo, and have a few small questions - anyone here able to answer a few?
[20:29:26] <samgranger> Well, first of all - lets say I have a few records in a table - if I select a random row and delete it straight away after selecting,is there a chance, even a tiny tiny chance, that another request manages to select the same record?
[20:30:22] <samgranger> And if so, is there a different secure way I can accomplish this? I want an option to only allow records to be read once basically
[20:33:36] <samgranger> Might be a weird question but I'm building a web app with certain unique keys in mongo - and let's say someone requests a key simultaneously, I don't want it to be possible that they receive the same one
[20:36:37] <Joeskyyy> only way that could happen would be if you're in a replset and you delete, but you're reading from a secondary
[20:37:28] <LucasTT> i'm getting an error when trying to install the database on a folder
[20:55:00] <LucasTT> well,at least it worked in the end.
[21:47:51] <mu> Hello. Can I ask a question about using mongodb here or is this a development channel?
[21:49:02] <Derick> this is an "ask questions about mongodb channel"
[21:49:19] <mu> I have a collection in which we store a bunch of documents with an array of tags... We want to be able to optimize a query for all documents with the same tag, and it looks like it's done through: ensureIndex("tags.Id": 1) and then just querying on that tag. Is that correct or is there more to it?
[21:49:52] <Derick> mu: can you pastebin a document?
[21:52:16] <mu> in the constructor we just do: @Document = mongoose.model('Document', DocumentSchema)... I'm thinking below that is we add an ensureIndex like I described?
[23:02:24] <evilC> Hi all, new to mongo here, and having a little trouple making the conceptual leap to mongo. Any help? My data structure is like this:
[23:34:39] <unholycrab> is it considered bad form to run the mongo config servers on the same instances as the mongod instances?
[23:34:55] <unholycrab> second, is there any reason not to run more than 3 config servers?
[23:38:40] <synth_> using pymongo i'm able to do pymongo.ASCENDING; is there an equivalent in PHP?
[23:39:30] <unholycrab> the documentation for sharded clusters says "Three config servers. Each config server must be on separate machines."
[23:40:00] <synth_> i understand the return value of pymongo.ASCENDING or DESCENDING will be a -1 or 1; I'm just curious if the php driver has a variable I can call versus using an integer
[23:40:08] <unholycrab> its a little ambiguous. does it mean at least three clusters? does it mean i can put my config servers on my mongod instances?
[23:40:27] <unholycrab> or is it stating that i need exactly three config servers, each on a dedicated machine
[23:49:47] <ElephantHunter> I'm experiencing an issue with the mongodb interactive tutorial
[23:50:10] <ElephantHunter> The server's responding with "Max number of collections exceeded" every time I attempt to add a collection
[23:50:33] <ElephantHunter> even when I'm running in completely new instances (incognito window) that have no existing collections