[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...
[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: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: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?
[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: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.