[00:32:45] <anybroad_> How to store image files? Should I put them into the mongodb document just like a blog (as e.g. in mysql)? Or rather store the sides outside the mongo database and reference to it using an id or filename?
[00:34:06] <anybroad_> well, an edit requires to know what to edit actually
[00:34:07] <harttho> If it's just referential, you could upload it and store the link
[00:34:12] <anybroad_> so you use the id or some other field as unique id?
[00:34:53] <anybroad_> harttho: so storing a large file like a image file (high resolution) in mongodb would degrade performance or cause issues? Because I was also discouraged from doing it with a mysql table.
[00:35:36] <harttho> There are services meant for storing images, especially if they're pulled often
[00:36:02] <anybroad_> harttho: oh, this is interesting. How is this called?
[00:36:03] <harttho> s3 or another CDN would be my suggestion to upload the file, then store a link to the image or path
[00:36:22] <anybroad_> harttho: and when there are multiple resolutions I would do it on deploy / build, right?
[00:36:39] <harttho> Can't answer that without knowing more about your solution
[00:37:58] <harttho> Need to know how/when/how often you're storing/retrieving the images
[00:38:09] <anybroad_> harttho: when I got a large image for zoom but want small thumbnails, I would then as you proposed (sound reasonable), resize those large images also to thumbs and store both on some cdn thing with an id in their filenames
[00:38:19] <anybroad_> and reference to those images using that id in the mongo db document?
[00:38:38] <harttho> sure, each image would have a document that could contain various images sizes
[00:39:53] <harttho> There you can give them meta-data, too
[00:40:18] <harttho> Pretty broad question though, and not necessarily mongo or sql related
[00:41:52] <anybroad_> harttho: yes, I know (my)sql well, but new to mongodb and I want to fully embrace it
[00:42:20] <anybroad_> harttho: So I create a document for the image and sub-document for each resolution with a reference,id or whatever to fetch them as resources from some cdn
[00:42:59] <anybroad_> 16MB limit is large, nice. The images don't exceed that size.
[00:43:22] <anybroad_> So I could store them directly, on the other hand, they are served then and it makes more sense holding them as static or prepared assets for some asset offloading proxy (nginx).
[00:43:40] <anybroad_> alright, this is more than just mongodb (as you just said), so I need to find something that fits the performance needs
[01:07:04] <harttho> And how your stack is layed out
[01:21:24] <fruitNvegetables> my db documents all have field "foodCategory", what query can I execute to get documents with the foodCategory field ALONE and no copies?
[01:25:34] <joannac> fruitNvegetables: Boomtime and I already answered that question.
[01:26:11] <joannac> if that answer didn't suffice, please elaborate on what's missing
[01:26:30] <fruitNvegetables> joannac: sorry, didn't see Boomtime's response, gonna check it out.
[01:36:50] <fruitNvegetables> joannac: so basically mongo can't spit out a query in that form I need my application to mutate it? That's fine it just didn't seem that efficient to me and that mongo might be able to do it.
[01:40:55] <alexi5> i have an document about a piece of equipment include its attributes and sub attriutes and want to allow users to comment on the piece of equipment does it make sense to put the comments in array in the document or should i put them in a new collection ?
[01:46:55] <joannac> fruitNvegetables: mongodb is a database; it provides data. there's some formatting that it can do, but you should consider formatting as something you'll need to do app-side
[01:47:49] <fruitNvegetables> joannac: wasn't sure how much formatting it could do for me
[01:48:15] <Boomtime> fruitNvegetables: you *can* get mongodb to do what you want, but in your case the situation is trivial and it would be overkill to get mongodb to do it
[01:48:49] <Boomtime> you have an array of values, and you want an array of key/values where the key is the same for every doc
[01:48:57] <fruitNvegetables> Boomtime: overkill how, as in a complex query relative to simple serve map?
[01:50:34] <Boomtime> fruitNvegetables: if you want mongodb to do it, you will need to use aggregation: http://docs.mongodb.org/manual/aggregation/
[01:51:00] <Boomtime> it's actually quite easy once you know what you're doing, but you'll need to learn that first, good luck
[01:51:36] <fruitNvegetables> Boomtime: .distinct doesn't seem to be in meteor.js api so I might want to do aggregation
[01:52:13] <Boomtime> ah yes, i remember now, meteor is crap
[02:05:01] <anybroad_> ladessa: yes, I had to do the same, there can be only one listen line in config.
[02:06:35] <adavia_> is this schema valid? https://dpaste.de/WmnZ
[02:24:52] <alexi5> when would someone choose a document database over a RDBMS ?
[05:33:23] <alexi5> I relational databases , when the schema changes you send ddl commands to the databases to make changes and update table data if necessary when the application is offline. I have heard apps using mongodb can continue running when new documents with different schemas are used. how do app developers manage document change ?
[05:44:18] <joeyjones> alexi5: the schema is at the document-level not at the table-level, so you can add new fields to your documents at any time and programatically handle checking if it exists for that document.
[05:46:37] <joeyjones> ie. I have a collection that holds book info called "book", and not all documents have a publisher, isbn, author, etc fields. I check at display what exists in the result and use it accordingly
[05:51:12] <joeyjones> alexi5: A document-based database really excels for flattened data with simple query patterns, ie news articles by date.
[10:35:07] <d-snp> hey guys, anyone ever seen this?
[10:50:04] <d-snp> thanks for the tips, I'll muck about a bit
[11:09:56] <tommy_the_dragon> I just downloaded the mongodb java driver (v2.9.3) and the class MongoClient cannot be resolved. Should I just be using Mongo?
[11:20:16] <tommy_the_dragon> I missed it because 2.10 is listed before 2.2 and I haven't had enough coffee :p
[12:15:24] <reese> hi, how can I check how many space has my data on each shard and how many space is free on each shard?
[12:20:59] <Mmike> Hello! I have a 5-member replica set. I kill 3 of my members, and the remaining are SECONDARIES - is this by design, or I did something wrong?
[12:30:38] <joannac> Mmike: by design. you no longer have majority
[12:31:09] <joannac> reese: combination of db.stats (), df, and du ?
[12:32:06] <Mmike> joannac: yup, need to have 3 nodes. What's with 7-member replicaset, is there 5 a majoriti, or also 3?
[12:38:02] <Mmike> and covering himself into tar and feathers
[12:46:05] <reese> joannac, so question is how can i increase disk space on my shard? when I add new shard free space on another shards is not increse. Why?
[12:48:58] <joannac> go read this http://docs.mongodb.org/manual/faq/storage/#why-are-the-files-in-my-data-directory-larger-than-the-data-in-my-database
[12:50:17] <n00b1234> mongo::client::initialize() <-- segfault in the legacy branch of the driver, what can i do?
[13:01:51] <reese> so joannac what does mean maxSize parameter when I add shard? I have situation where filesize on shard is around 80GB but i set maxSize on shard as 65000MB?
[13:11:04] <joannac> "If mapped size [1] is above a shard’s maxSize, the balancer will not move chunks to the shard. Also, the balancer will not move chunks off an overloaded shard. This must happen manually. The maxSize value only affects the balancer’s selection of destination shards."
[13:13:22] <reese> so if filesize is higher then maxsize this shard not take more data yes?
[13:59:42] <Tommeh_> hey all, is there a way to tell mongos to select a non-primary merge shard?
[14:00:29] <Tommeh_> Looks like the default behaviour is to select the primary: https://github.com/mongodb/mongo/blob/v2.6.3/src/mongo/s/commands_public.cpp#L2240
[14:00:44] <Tommeh_> Is there a good reason for that?
[14:01:22] <Tommeh_> Could it be round robin? My primary is melting and the other shards are chilling out :)
[14:57:48] <RaceCondition> is dot-notation in queries supposed to work only up to 2 nesting levels?
[14:58:17] <RaceCondition> i.e. just {"foo.bar": "hello"} and not {"foo.bar.baz": "hello"}?
[15:03:12] <RaceCondition> cheeser: but it's not... and I'm really confused as to why
[15:05:24] <RaceCondition> this is what I'm seeing: http://pastebin.com/sdZWNFd8
[15:06:00] <RaceCondition> there's a doc in the DB with data.first_name = "Test" and data.location.street = "Foo"... I can successfully query on data.first_name but data.location.street returns an empty result set
[15:06:20] <RaceCondition> is that expected behavior?
[15:10:27] <RaceCondition> ah, this is embarrasing: I've been typing street instead of street1!
[16:28:17] <DavideD> Hi all, I'm using the MongoDB jdbc Driver and I'm trying to create a user but the command always fails with "no such method"
[16:29:06] <DavideD> I'm using db.command("{createUser: 'davide', pwd: 'asdfa', ... }" is that correct?
[16:29:29] <DavideD> It is the driver fo ra Java application
[16:30:17] <DavideD> if I use db.addUser(...) everything works fine but this method is now deprecated
[16:30:44] <DavideD> sorribas, what am I doing wrong?
[16:46:58] <valenciae> Hello everybody. We've been having issues with our mongo replica. Our web servers complain of not being able to find the master and the site just fails.
[16:47:12] <valenciae> We have not done any changes or updates.
[17:22:49] <superbeef> Maybe somebody can help me digest this from the mongo manual : • http://docs.mongodb.org/manual/reference/method/db.repairDatabase/#db.repairDatabase obtains a global write lock and will block other operations until it finishes.
[17:23:07] <superbeef> does that make ALL databases are locked when running repairdatabase on one database, or just that database is locked
[17:26:20] <kali> superbeef: i think just the one, because locks used to be global but are now database per database
[17:26:37] <kali> superbeef: but i have not tried it
[17:28:15] <superbeef> kali: thanks… sounds like it still may be questionable on these mongo 2.2 boxes i'm stuck with
[17:29:14] <kali> ha ! in 2.2 there is no question. it will lock everything
[18:11:44] <Hasan> A question. what does a collection mean? For example: is that a user is a collection? and anything related to that user will be stored inside that collection?
[18:13:11] <kali> a collection is analogous to a table in relational databases
[18:14:58] <Hasan> Ok, i was recently reading some articles on Mongo, and i am confused in some areas ,, is that we cant fetch data from two collection at a time?
[18:53:27] <cipher_|> What is the difference between mongod and mongos (I know this is used for the router)?
[21:40:57] <waqasxo> does anybody know of a good php framework designed esp for mongo?
[21:41:53] <netameta> how do i delete mongoose schema ? or modle, i had a certain schema, i create an entry, and then change the scema a bit, now when i create other entries to the new scema i get duplicate entry error for the (null) of the missing field - is there a way to delete or some how reset the schema ?
[21:49:45] <joeyjones> netameta: It sounds like you have a unique index on that field. Try using Robomongo to access the collection and check the indexes.
[21:50:19] <netameta> joeyjones yea i do hae unique index on that field
[21:50:46] <netameta> but i dont need that field anymore thats why i want to reset that schema somehow
[22:08:52] <joeyjones> netameta: That's likely a file for the initial creation of the collection at first use so if the collection already exists it likely won't be changed. Use Robomongo (http://robomongo.org/), connect to your db, and check the indexes for your collection.
[22:09:43] <netameta> joeyjones yea i will do that i guess
[22:11:06] <joeyjones> It's also good to have a client on hand for the database anyway, that way you can verify things at the low level
[22:14:31] <netameta> Joeyjones, Ah wow this client is really awesome
[22:15:53] <joeyjones> If you look in the indexes for the collection you can either delete the unique index or remove the unique flag from it
[22:18:29] <joeyjones> I'm glad you like it. The first thing I do when using a new technology is try to find an IDE for it, that way the adoption process isn't as painful.
[22:53:12] <MacWinner> hi, if I want to make a certain attribute in all documents in my collection lowercase, what's the easiest/fastest method? i have an example that does a forEach on the collection, and then saves each individual documnet.. is there some faster way with a bulk update type of thing?
[23:02:43] <lexi2_> is there a perfomance loss of using smallerfiles with mongodb, and is there a way to set that manually or do i need to recomplie the db
[23:09:42] <anybroad> For a collection of e.g. categories, should I use singular or plural name? 'category' vs 'categories' for a collection of categories (which is referenced to in other documents in the same database)?
[23:13:08] <BigOrangeSU> hi can anyone recommend a method for creating a mongo shell script to rebuild a database? I am going to create a script that can be run and will create the users etc.