[03:58:40] <charlesos> hey all, is anyone familiar w/ mongoose for node / willing to help w/ a newb question?
[04:00:09] <charlesos> i want to search for a document by objectId which could be one of a few different types of models, is there a good way to do this?
[10:52:05] <phira> I'd always store files in it given the option.
[11:03:07] <NodeX> it's certainly a good way to store files for portability
[11:33:53] <e-dard> Any mongoengine users in here?
[11:34:24] <e-dard> If one of my classes calls mongoengine.connect() to one DB on one host, and then later on another class somewhere else calls mongoengine.connect() to another DB on another host, what happens when in another class I do doc = Collection(**attributes); doc.save() ??
[11:54:00] <__neilg_> @Derick: i fixed my problem from yesterday (if you can remember it). Just ifdown/ifup'ing the interface gave replication a kick in the butt, probably because all active connections were killed?
[11:54:20] <__neilg_> (if you don't - replication was slow during initial sync)
[14:21:13] <Pilate> Are there limitations on the query filter object when doing runCommand mapreduce? it seems to return 0 records when using a regex, but works fine if i match exactly
[14:54:56] <therealkoopa> Using mongoose, I want to find an object and all its embedded documents, but filtering the embedded documents at the same time, based on a boolean flag. Is this possible?
[15:31:17] <locojay> hi anyone familiar with mongo-hadoop streaming?
[16:23:16] <queso> Is there a way to prevent mongo from using +2GBs when initiating a new instance? I am testing it on a server that has just under 2GB of free space and it keeps running out of space.
[16:28:02] <FerchoDB> Hi. Are you familiar with C# driver? Is it possible to do myCollection.EnsureIndex(new IndexKeysBuilder().Ascending("address.city")); // i.e use dot notation
[16:32:31] <augustl> hi folks. Want to set up some integration tests against a HTTP API that uses mongodb, and reset all data between each test. In postgres I just droped all the tables and created new ones for each tests. I suppose for mongo I can just delete all the dbs?
[16:35:17] <queso> linsys: The only suggestion that page has given me (and I found that page before coming to this channel) is setting it to not preallocate, which I did in /etc/mongod.conf, sudo rm -rf /var/lib/mongo/* ; sudo service mongod start and it again filled up my disc. Help?
[16:38:00] <FerchoDB> Hi. Are you familiar with C# driver? How can I index a sub-document? I tried "myCollection.EnsureIndex(new IndexKeysBuilder().Ascending("address.city")); "but doesn't work
[16:40:09] <linsys> queso: probably want to add "noprealloc = true" and oplogSize = 0 and nojournal = true
[16:52:58] <VibesTriton> I'm new to mongodb. I want to update an object with $set like this... Collection.update({propname1:unique_key}, {$set{propname2:value}}) What I can't figure out is how to modify propname2 when it is located several objects deep inside the returned object. How can this be done?
[16:54:30] <ankakusu> NodeX, I started mongodb as follows:
[17:54:11] <jenner> guys, how do I force a new secondary to sync from other secondaries instead of primary on a 2.0.6 replica set? initialSync?
[18:55:54] <dstorrs> oh Mongo channel, grant to me your wisdom. I've got a couple of stats interns who need access to our DB in order to do their job. They have zero Mongo experience, and I don't want to give them access to the prod DB directly. The DB is too large to make copyDatabase desirable, although I suppose I could if I absolutely had to. What's my best option?
[18:58:16] <dstorrs> Does the secondary have to be a precise copy, or could it have a locally-defined writable database that can be a sandbox for them?
[18:58:40] <Derick> secondaries are by definition a full copy I supose
[18:59:14] <dstorrs> but secondaries run their own mongod, yes?
[19:02:12] <dstorrs> ah, sweet. thanks. I've RTFM'd pretty much everything else in the docs, but never paid attention the GUI sections because I'm a CLI guy myself
[19:56:02] <Derick> FerchoDB: please feel free to ask questions here; googling does help though :)
[19:58:51] <FerchoDB> Thanks derick. It's not that I haven't googled it, but sometimes I try to get info from official doc because it's true that as there are so many drivers, google is a mess. But now I saw that db.dropIndex.help() for this case, gives a lot of info
[19:59:40] <FerchoDB> I have looots of tabs with results, also lookoing for some info related to the C# driver, but now I'm getting along with
[20:04:53] <ron> ah. never really understood twitter.
[20:05:02] <ron> it seems only the hip people know how to use it.
[20:09:56] <augustl> form the docs: "The maximum size of a collection name is 128 characters (including the name of the db and indexes). It is probably best to keep it under 80/90 chars." why is that?
[20:14:22] <kali> augustl: the collection name is used to build other names (like index names, or temporary collections for map reduce). if its already big, you may run into... issues :)
[20:16:04] <joaquin> db.meta.find({"pk":{"$type":1}}).forEach(function(item){item.pk = new parseInt(item.pk); db.meta.save(item);});
[20:16:49] <augustl> my app will store "events". I'm thinking one database per event makes sense, there'll be no shared data between events. But that means having a gazillion databases after some time. Is that a problem?
[20:17:13] <kali> joaquin: it's because of javascript lack of type. there are wrapper to specify what number type you want... lemme find you the page
[20:18:41] <kali> joaquin: wrap item.pk in a NumberLong instead of a parseInt
[20:20:05] <kali> augustl: each database will be allocated separately on the disk, and each database take at least 200MB on the disk with default settings
[20:20:52] <kali> augustl: then, ther eis the issue with the gazillion. you need to define how big a gazillion you imagine
[20:20:59] <augustl> kali: would you say it's better to use one database and have a "event_id" type thing in the "attendants" collection?
[20:22:16] <joaquin> kali: I did this: db.meta.find({"pk":{"$type":1}}).forEach(function(item){item.pk = new NumberLong(item.pk); db.meta.save(item);});
[20:22:37] <joaquin> kali: but it does not change the type : db.meta.find({"pk":{"$type":1}}).count() 11
[20:22:39] <kali> augustl: what about one collection for attendants, one collection for events ?
[20:23:17] <augustl> kali: you mean one collection of attendants per event? Or one collection for all attendants, and storing the ID of the event along with the attendant and filter on that?
[20:24:22] <augustl> one collection per event seems bad too, since there's a limit to the number of collections
[20:24:41] <kali> augustl: it would work, but i don't know your use case, and you'll be the one to liev with it :)
[20:25:06] <augustl> kali: it = one events collection, one attendants collection, and "foreign keys"?
[20:25:34] <kali> augustl: it's the "obvious" answer, but maybe it's wrong... for archiving old events for instance
[20:29:55] <augustl> http://shop.oreilly.com/product/0636920018391.do aww, "This product has been canceled."
[20:31:04] <augustl> btw, having references to other documents is not "bad" or anything? And it's as easy as just putting the ID of another document in some document?
[20:31:14] <kali> joaquin: http://privatepaste.com/4ef75372b5 work for, can you cut and paste what you're doing ?
[20:55:10] <augustl> any particular reason for not using 2.1.1? We'll be in production a couple of months from now, perhaps 2.1.1 is the recommended production release then (ish)?
[20:55:33] <augustl> where production = incredibly low scale beta with few customers :)
[21:04:48] <wereHamster> augustl: does 2.1.1 have any features that 2.0.x doesn't?
[21:04:59] <wereHamster> (features that you need...)
[21:07:09] <dstorrs> so, yes, don't use a dev version that will always be a dev version and has no features you're sure you need as your production version. :>
[21:10:01] <FerchoDB> me again. I'm reading about indexes in official Doc, and I have a doubt. Here: http://www.mongodb.org/display/DOCS/Indexes#Indexes-AdditionalNotes . It says:
[21:10:05] <FerchoDB> "Document indexes like these cannot be used to search for queries using their (embedded) parts, like "state" in this example. When you search you must use a prefix, or the whole document, of the embedded document as if they were stored as opaque blobs"
[21:10:33] <FerchoDB> When it says "you msut use a prefix", y means you can search only in the FIRST field with a prefix?
[21:12:20] <FerchoDB> I understand that if you make a search by an embedded document, it will not return results if you provide only one of the fields
[21:12:36] <FerchoDB> unless you use $gt like in that example,
[21:12:57] <FerchoDB> but I'm not sure what it means with "you must use a prefix" in that case
[22:38:59] <E1ven> Can anyone give me a list of indexes I should be using on GridFS for best practices? I'm indexing filename, and db.fs.chunks.ensureIndex({files_id:1, n:1},{unique:true}), although I understand the latter is supposed to be taken care of by the driver. Are there any others that I should add for best performance?
[23:08:37] <murrdoc> quick question … when using hint() with count in php … does the hint() call go before the count() call or after
[23:15:16] <dstorrs> murrdoc: I don't believe it matters, but TIAS
[23:15:34] <dstorrs> hey all, how do I stop a currently-running map reduce?
[23:50:34] <ferrouswheel> hello world. slightly weird situation. Trying to solve "Connection reset by peer" using pymongo.
[23:51:12] <ferrouswheel> It occurs after a brief network outage, and is fixed by reloading apache2 (where pymongo is being used by a Django project).
[23:52:53] <ferrouswheel> Obviously manually reloading apache is not optimal, and somehow pymongo gets stuck in a non-useful state. Any ideas on how I can implement something to avoid the manual reload? Anyone had similar experiences?