PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Sunday the 10th of March, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:38:15] <muesli> how can i query mongo to return all documents which have a subdocument that contains a certain key?
[00:38:48] <muesli> e.g. i have a document, which contains the subdocument "dbinfo" : { "foo" : "bar" }
[00:38:53] <Derick> find( { field.subkey : { $exists: true } } ) ?
[00:39:04] <Derick> or do you mean:
[00:39:06] <muesli> i'd like to find all documents where the subdocument dbinfo contains a "foo"
[00:39:24] <Derick> find( { dbinfo.foo : { $exists: true } } ) ?
[00:41:24] <muesli> Derick: thanks so much!
[00:52:31] <Derick> np
[08:04:27] <tomlikestorock> can I query a collection filtering on where an item is in a list, and then order by the indexes of the item in those lists?
[13:28:57] <tombee> Are there any benefits to using the generated _id field that mongo provides. So for example, if I have an Account collection and I 'username' is a unique identifier, should I use username as the _id or should I leave _id there and provide a unique index on the username field.
[13:47:20] <FrankBullitt> tombee, you still there?
[13:48:00] <FrankBullitt> my irc client doesn't have timestamps...
[13:56:43] <tombee> Hi FrankBullitt. :)
[14:00:39] <FrankBullitt> yo
[14:01:55] <FrankBullitt> So, the _id field is mandatory and feel free to use it for your app and it can take the place of a PRIMARY KEY in an RDBMS, however ... MongoDB is not a RDBMS so that doesn't have the same significance.
[14:02:32] <FrankBullitt> But you probably still want to index username, because I imagine most of the time you'll be 'selecting' on that.
[14:50:29] <tombee> FrankBullitt: That's great, so if you were developing such an application (the username thing is purely the first example that I thought of), would you keep the default behaviour of _id and create a separate field for username and index that?
[14:52:35] <NodexCMS> separate field
[14:53:01] <FrankBullitt> tombee, yes, and if I had the option to do a lookup on username or objectid I would go with the objectid, it is the primary key
[14:54:12] <FrankBullitt> tombee, I also recently learned that the id has some cool functionality. For example, it's generated based upon creation date so you do a .getTimestamp(); on it to get the creation time.
[14:56:32] <tombee> FrankBullitt, NodexCMS: That's great, thanks for the information.
[15:12:01] <genazt> hi
[15:12:39] <genazt> i have a question about expireAfterSecond indexes. i have one set to 600 and a collection with an expire key in the documents. not all documents have it but some do.
[15:13:23] <genazt> since the docs tell me that mongodb will ignore the documents which dont have the key i want to index for, it should expire all documents which have a expire date object which is older then 10 minutes
[15:13:42] <genazt> but it doesnt, the docs are still there (the without expire and the ones with an expire key)
[15:46:03] <alex88> I've an object like {name: "text", value: 10, timestamp: 9999}, is possible to get an object like { "onename": [{value, timestamp}...], "secondname": "[{value,timestamp},...] } as result of a query?
[16:05:13] <alex88> I've tried collection.group({ key: { name: 1 }, initial: { results: [] }, reduce: function(obj, prev) { prev.results.push(obj) } }).find(etc) but I get
[16:05:26] <alex88> TypeError: undefined is not a function
[16:05:26] <alex88> at Collection.group.scope (/Users/alessandro/Sites/visup-monitoring/node_modules/mongodb/lib/mongodb/collection.js:1419:30)
[16:49:00] <FrankBullitt> Is mongoimport supposed to import JSON or only its extended JSON?
[16:52:30] <FrankBullitt> or neither?
[16:52:56] <ron> 'extended json'?
[16:53:22] <FrankBullitt> http://docs.mongodb.org/manual/reference/mongodb-extended-json/
[17:49:59] <dstanek> so i'm going through the long process of compacting collections - if i do more frequent compacts will they be faster?
[19:15:17] <patryk_> Hi All, having some trouble: Ubuntu 11 64bit, installed mongodb-10gen (v2.2.3) trying to run mongorestore on a mongodump. Keep getting "can't take a write lock while out of disk space" --except df -a returns a highest usage of 18%. Really confused.
[19:15:30] <patryk_> Does anyone have a moment to help me troubleshoot?
[19:15:31] <patryk_> thanks
[19:20:38] <patryk_> Ahh, crap. I think I have a permissions error.
[19:31:42] <patryk_> still having problems with the /var/lib/mongodb/_tmp directory. :/
[19:57:02] <patryk_> YEAH! :D
[19:57:05] <patryk_> got it!
[19:57:42] <patryk_> I had installed the Ubuntu mongodb package initially -but because it's not pre-compiled with UTF-8 support, I uninstalled it and instead installed it from the 10gen resource.
[19:59:07] <patryk_> either I didn't uninstall something before installing the 10gen version, or the 10gen version itself didn't install correctly, but what ended up happening was the /var/lib/mongodb directory (where the .lock and DB files are) didn't have the correct permissions of the mongodb user to be able to write to it.
[19:59:17] <patryk_> set the permissions correctly. everything works.
[19:59:21] <patryk_> laters :)
[20:25:44] <tomlikestorock> Is there a way to query, or use aggregation in some way to return the ranked row number for a result set?
[21:18:10] <tomlikestorock> I guess that's a no?