[00:04:23] <chronidd> I have a composite _id field (i.e. my documents look like {"_id":{"foo":1, "bar"2}, "value":{"v1":1, "v2":2}}, and in my aggregations, I can't seem to group by a sub-component of my _id, just the entire thing. Anybody know if that's supposed to work?
[00:06:01] <chronidd> i.e. { $group : { _id : "$_id.foo" , v : {$sum: "$value.v1" } } produces null for the group's key. BUT if I just specify "$_id" in the groups id, it includes the entire id as the id of the group.
[00:10:50] <chronidd> Just found out that if I add a $project step before my group, I can pull the items I want out of the composite id, so that's an okay workaround for now, I just wonder why I can't include subfields of the id in my aggregation.
[00:30:54] <opus_> http://stackoverflow.com/questions/13187486/mongoose-nested-document-update-failing Hey guys I'm having this problem
[01:03:20] <chronidd> For those following along at home, found the bug that was tripping me up -- https://jira.mongodb.org/browse/SERVER-7491
[03:18:01] <mariooo> hi there. working on a quick URL shortener app to learn more about mongodb
[03:18:21] <mariooo> kinda stuck at generating a unique base62 'code' for a shortened URL
[03:18:45] <mariooo> kinda stuck conceptually in SQL land, where I'd just id.base62_encode
[03:19:09] <mariooo> but mongo's document IDs are not numeric, and incremental index numbers don't seem to be encouraged, so unsure what the go would be here...?
[03:20:15] <mariooo> a solution is to just have a separate function that brute forces a unique code based on random numbers, but was wondering if mongodb had something elegant built that would be cleaner
[03:36:34] <crudson> mariooo: document IDs can be whatever you want, but even so you could use any other field. Performing atomic number incrementing (ala SQL sequence) is simple in mongodb and is explained in the core docs. I'd also suggest base 36 as upper and lower can sometimes be hard to determine between certain characters.
[07:34:20] <crudson> fleetfox: right, have a computed sort field that does it, or...with aggregation you can calculate a new field in the pipeline then use that to sort
[07:35:19] <fleetfox> i honestly want to punch i the face one whoo choose mongo for this project
[07:35:44] <crudson> fleetfox: if it's a relatively simple mathematical expression you can do it with aggregation: http://docs.mongodb.org/manual/reference/aggregation/
[07:37:02] <crudson> fleetfox: but as for arbitrary javascript, then no
[08:16:39] <Guest88699> Hi Has anyone here used morphia to access mongodb?
[08:17:57] <Guest88699> My question is that if I use @Embedded to make a List of Child Java Objects, then what is morphia's default fetching behavior. when I get the parent object will everything embedded also get loaded? or is this some sort of a lazy load?
[09:01:58] <kali> Gargoyle: well, there are apostrophes and apostrophes
[09:02:09] <Gargoyle> NodeX: This is data coming from mongo, I am doing a mb_strtolower() and trying to put it back (with $set) and getting non utf-8 errors. If it's non utf-8 how the hell did I get it in there in the first place! :S
[09:03:06] <Gargoyle> According to a bit of checking.. .it's all ASCII!
[09:03:08] <kali> Gargoyle: the ascii character is a quote, not an apostrophe, so many people will use the more accurate unicode characters
[09:08:35] <Gargoyle> I just passed them through iconv('ASCII', 'UTF-8//IGNORE//TRANSLIT', $searchname), and afterwards, mb_detect_encoding() thought even more of them were ASCII!
[09:12:06] <Gargoyle> Thanks NodeX, That seems to be working even though mb_detect_encoding tells me its ASCII
[09:12:30] <Gargoyle> Oh and.. Processed 179160 of 176908 (Skipped: 0).
[09:38:22] <NodeX> slightly off topic but does anyone know a deamon that will accept any stream I throw at it, check some authentication and pass onto another service
[11:41:26] <Gargoyle> Was A bit expensive, but my previous samsung has done 10 years hard time - so I don't really mind! :)
[11:42:38] <mamalujo> hi! Are there any instructions, or pitfalls you might know of, in running mongo on top of a distributed filesystem?
[11:44:15] <Derick> mamalujo: what is the underlaying thought about doing that?
[11:48:17] <mamalujo> Deric, rather than dedicating storage resources for mongo machines, and fiddling w sharding and replication in the mongo layer, and since we already have a cluster (w moosefs) running, we though to use it, w each mongo server storing in some directories in the distributed fs.
[11:48:39] <Derick> mongodb is mostly limited by memory, so distributing the filesystem doesn't help really
[11:50:04] <mamalujo> Derick: ah, so for performance reasons, we'd still need to shard etc. I see.
[11:52:28] <NodeX> Gargoyle : mine was on offer for £325 - (£150 off)
[11:54:58] <mamalujo> Derick: a related q then, if you'd indulge me - provided we do shard the dataset on the mongo machines, we could still alleviate the need for replication if the storage layer were already on a replicating dfs, no?
[11:55:53] <Derick> mamalujo: I would leave the replication to mongodb. Having each of the replica nodes use the same files seems like a receipe to disaster as nothing would be locked on the FS level causing lots of corruption
[11:58:28] <mamalujo> I thought, w separate dirs there for each machine, each buffering a part of the data, hopefully that wouldn't include accessing the same files, but anyhow, y, I see your recommendation is still - do it in mongo; which is sufficient response, since we were mostly wondering about the recommended practices.
[12:00:30] <dingens> Is there a limitation for the aggregation framework's ability to match? My example collection has documents where the _id field is a dictionary (e.g., _id : { key: <somevalue>, bucket: <some-othervalue> }). When collection.aggregate is called with { $match: { _id : { key: <somevalue>, bucket: <some-othervalue> } } } no result is returned although documents with these values for _id are in the database. Is this some kind of general l
[12:00:30] <dingens> that I should have seen in the documentation?
[15:31:50] <Pego> i have an issue with lock, if anyone can help it would be great :) : i use mongodb 2.0.6 when i lock a secondary with { fsync: 1, lock: true } it's getting stuck and even login after that. the primary is ok. but the mongos is stuck/slow. any idea please ?
[17:10:05] <denom> Hey all I'm using mongoose (node.js) to connect to mongodb and I'm noticing that 'open' event is never being fired on my connection. How can I debug this?
[17:16:43] <tystr> is comparing optime of members in a replica set a good way to monitor the status of the replication?
[17:16:56] <tystr> e.g. monitoring how far behind a secondary may be?
[17:37:01] <hdm> mongo has a much better way to do that using update with the upsert flag
[17:37:25] <hdm> which is basically a find clause followed by commands to update, and you can use things like $set or $inc or $push
[17:38:06] <hdm> my guess is your save() fails for some reason though in the create, check the return value or add a !, but consider using an upsert instead
[17:39:08] <mrgreenfur> hdm: interesting. Where do I put the ! ? Foo.find_or_create_by(bar:=>…)! returns a syntax error. Is it Foo.find_or_create_by!(params)?
[17:39:43] <mrgreenfur> or should ij ust tack on .upsert?
[19:33:35] <mrgreenfur> hdm: thanks again. you've been tremendously helpful!
[19:44:41] <hdm> mrgreenfur: np, good luck, just started to use mongoid recently as well
[19:58:11] <wting> I'm trying to get mongo running on a Debian server following the instructions here: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-debian/
[19:58:26] <wting> I'm unable to start mongo daemon, and no logs are being written to /var/log/
[19:59:00] <Guest56110> What command are you using to run it?
[20:02:55] <doxavore> wting: does /var/log/mongodb/ exist and writeable by your MongoDB user?
[20:03:12] <wting> doxavore: No, I'm creating / chowning now
[20:05:23] <wting> There we go, have log files now. Not sure why mongodb doesn't create directory if missing considering I'm starting/restarting it as root.
[20:06:02] <doxavore> I think I ended up just changing my config to /var/log/mongodb.log because I was tired of forgetting to change that. :)
[20:09:20] <Ephexeve> Hey guys, question, I am using mongodb with Python, but I wonder, I have a function where the user add a srctype and a link (http://bpaste.net/show/AuCi2Bwq0stDWfpwWfck/) and another function which I am trying to implement which gets the data according to the src type, somthing like "SELECT * from tablename where srctype="hello"), but I wonder how this would be.. find_one(srctype) ?!
[20:10:15] <hdm> db.collection_name.find({ srctype : "hello" }).limit(1) for a single record
[20:10:38] <hdm> (not sure how that maps to the python api)
[20:11:15] <Ephexeve> hdm: find_one is the function.. Hmm will try.. a bit confused here.. still used to sql..
[20:15:22] <aranea> Hi there. I have an enhancement proposal for your code, but I'm too lazy to create an account on your JIRA.
[20:16:10] <aranea> in src/mongo/util/version.cpp, line 161, the following call is done: if (boost::filesystem::exists("/sys/devices/system/node/node1")){
[20:16:43] <ron> you weren't lazy to make the proposal but you're too lazy to create an account on JIRA? seriously?
[20:17:22] <aranea> on my system, /sys/devices/system/node isn't readable for the account under which mongo is running, that leads to a complete failure of mongo
[20:18:27] <Ephexeve> since the user says when inserting the source type is called "something": "www.google.com" -> if I try to find({srctype:"something"}) doens't work
[20:20:21] <crudson> aranea: I'd create a JIRA for it. That's the only way it will be addressed.
[20:21:45] <aranea> crudson: If I'd create an account for each software I find bugs in, that would be /a lot/ of accounts, so I'm trying to avoid that...
[20:22:34] <hdm> Ephexeve: or, you need to see if the key is set
[20:22:40] <crudson> aranea: maybe there needs to be a JIRA for JIRA to use openID
[20:44:51] <Ephexeve> aranea: No worries, when I finish writting some code I will do that, 30min or so, are you sure this is a bug? What title ?
[20:55:41] <Ephexeve> I really wonder how this would work out
[20:55:58] <aranea> Ephexeve: What about "Mongod fails if it doesn't have read permissions on /sys/devices/system/node/"?
[20:56:36] <Ephexeve> column called srctype, another called url, where when calling the first row of scrtype, gives me the first item in the row of url
[21:07:12] <aranea> Ephexeve: Could you just write an email or a memo when you're done? I've got to go now...
[21:08:22] <aranea> Ephexeve: sent you my mail as pm
[23:11:32] <silverfix> I'm starting with MongoDB. I've got a collection and I'd want to retrieve one item of this collection, do something with it (with python/flask) and then update one of its attribute. The point is: how can I use e.g. findOne for retrieve a different item at once ?
[23:29:09] <crudson> silverfix: not sure I understand the question...
[23:29:42] <crudson> silverfix: how do you specify which document you want to retrieve?
[23:29:55] <Gargoyle> gimme a mongo driver, and I'll segfault it.