[00:29:00] <MedicalJaneParis> i have a 3 node replica setup, primary and two secondaries. one of my secondaries went down and my clients (nodejs) are occassionally throwing errors
[00:29:03] <MedicalJaneParis> "No replica set member available for query with ReadPreference undefined and tags undefined"
[00:30:26] <MedicalJaneParis> now that i think about it, it may be ignoring the pref in the URL, since i pass in an object. ill try adding it there
[02:29:36] <b1nd> anyone know why I am unable to save data to my mongo db?
[02:29:53] <b1nd> It is almost like each new connection has it's own database results
[03:24:07] <fresh2dev> if I have 1000 customer databases with different credentials, using the node.js native driver... it seems i have to call .connect 1000 and can't reuse the same mongoclient or db object. this seems "heavy" as it basically opens 1000 connection pools. does anyone have good resources on this.... I've found this post describing similar to what i'm trying to do: http://stackoverflow.com/questions/15680985/what-is-the-right-way-to-deal-wi
[03:24:07] <fresh2dev> th-mongodb-connections but i can't find any definitive best practice for this sort of thing
[03:26:40] <fresh2dev> i haven't tried this yet but the only sane way i think is to remove the different credentials from the databases and make them all use the same username and password and then i can reuse the same connection pool?
[04:40:30] <in_deep_thought> right now to connect to my mongolab mongodb, I use this: http://bpaste.net/show/zpGPZFje4vZT8oUaRtV6/
[04:41:11] <in_deep_thought> however I want to use this same production db with my local code. should the same thing work? or do I have to substitue process.env for something?
[12:20:28] <Feel> Hello. I start learning the MongoDB and have a question. In MongoDB two object document can have different field number. For example, in collection "Users" I can have two object documents - 1) With a key "Name" 2) With keys "Name", "Surname". But how MongoDB been works if I want get all names in "Users"? (second document hasn't key "Name").
[12:25:18] <jsfrerot1> hi, i'm trying to test a restore for mongodb sharded cluster, and following the documentation i'm missing some command details.
[12:25:45] <jsfrerot1> I'm following this procedure: http://docs.mongodb.org/manual/tutorial/restore-sharded-cluster/#procedure
[12:26:05] <jsfrerot1> and I'm wondering how to do this step: Restore the Config Database on each config server.
[12:26:21] <jsfrerot1> i'm obviously new to mongo, so any help would be appreciated
[12:29:58] <ggoodman> Given documents with the following (partial) schema: { identities: [ { user_id: id_1, service_name: service_1 }, { user_id: id_N, service_name: service_N } }
[12:30:49] <ggoodman> I would like a unique index so that no two documents can be created with the same {'identities.user_id': 1, 'identities.service_name': 1} pair.
[12:31:20] <ggoodman> My issue is that I would also like documents that have no identities and this seems to cause the unique index to fail. Anyone know what's going on?
[12:33:42] <ggoodman> Just found: https://jira.mongodb.org/browse/SERVER-3934
[12:43:56] <ggoodman> Seems the index works if made sparse: true
[14:07:23] <locojay> hi when running a query i get error: { "$err" : "BSONElement: bad type 109", "code" : 10320 }
[14:17:39] <locojay> if i traverse the collection with pymongo i get AssertionError: Result batch started from 0, expected 205881
[14:25:10] <locojay> anyway i can find this s..ker
[14:42:15] <locojay> i identified the doc within a range based on some attribute but when i try to remove i get BSONObj size: 1597071153 (0x315F315F) is invalid. Size must be between 0 and 16793600(16MB) First element: mall.jpg: ?type=115
[18:12:29] <foofoobar> Hi. Some architectural question: I have a "Group". This group has "Albums". Each album contains "Photos".
[18:12:44] <foofoobar> Photos may be a huge list of links (e.g. 800 photos)
[18:13:34] <foofoobar> My current structure is something like: Group { albums: [albumId1, albumId2, albumId3]}, Album { photos: [photoId1, photoId2, photoId3]}
[18:14:08] <Derick> I'd store a document per photo:
[18:14:10] <foofoobar> Is this the right approach or should I make one huge Document like Group { albums: [ { photos: [...] }, ...]}
[18:23:29] <foofoobar> Derick, is that approach better?
[18:48:00] <arussel> I would like to run some function regularly (fetch some doc, update based on some attributes ...). I'm not sure how/where I should store the function diffinition
[18:50:05] <arussel> why does the doc states: We do not recommend using server-side stored functions if possible.
[18:55:27] <arussel> or is there a way to send a javascript file to be run by the server ? (I can't store it on the same machine)
[19:00:53] <ranman> arussel: you can run it on an app server? you can send functions to be executed over the shell
[19:00:59] <ranman> and the shell can execute arbitrary javascript files
[19:01:14] <ranman> but yes storing it in a document as a code object is possible but not recommended
[19:01:24] <ranman> mainly because it becomes harder to edit and view
[20:36:58] <hocza> When I want to use reference (one to many or many to many) for example: category [{"name": "Test", "_id": ObjectID("535621784d5001f173000001")}] and in my Transactions collection, when i use the ref, how should I store it?
[20:45:58] <hocza> I have a mysql DB and porting it to mongoDB, and it just felt a bit strange but its okay then. :) Couldn't find a very-well explained example
[20:46:46] <tscanausa> store it like you would do with foreign keys
[20:47:28] <hocza> basically a transaction contains a: date, resource_id, category_id, amount, Tags[this going to be embedded], ItemName, Status
[20:47:41] <hocza> hm okay. So in mongoose i just should go with
[20:50:23] <hocza> When my boss decided: hmm, what if I could give more addresses to someone? I was like, oohh you got to be kidding me, I asked that if you ever need to store more than 1 address... now i would go with: address: [{...}]
[20:52:04] <hocza> And this node.js as backend javascript... and frontend javascript programming... Using a single language for a web app... hmmm :) And with mongoDB i can store my objects without converting to mySQL tables... and back...
[20:53:11] <tscanausa> nice to see you are going full koolaid with javascript.
[20:53:52] <hocza> I do not know what koolaid is sorry :(
[21:20:28] <Efrem> Is there a limit to how many levels of embedded documents you can have? I am looking at storing a tree as a single doc but I feel like that could be dirty/smell.
[21:21:59] <kali> Efrem: it can get difficult to query subdocument of subdocuments of a document
[21:22:23] <kali> Efrem: but if it's just storage you need, no querying, then it should not be a problem
[21:22:53] <Efrem> hmm, yeah that's a good point. The data I'm going to store shouldn't need to query anything that deep. It's just storage of brackets for competitions.
[21:26:35] <kali> Efrem: local update can get tricky too
[21:27:03] <Efrem> yeah I would have to rewrite the entire doc on update, for the most part, wouldn't I kali?
[22:35:46] <joannac> dberg2: here are 4 documents. which ones should match http://pastebin.com/Dn1YtiYU
[22:36:50] <dberg2> I want to say everything that does not include the pair (a = 1, b = 1)
[22:36:57] <dberg2> this should return the last 3 records
[22:39:08] <jhubert> Hi everyone. I’m trying to use the aggregation framework to do get some stats out of a mongo collection. I’ve outline the problem here: https://gist.github.com/jhubert/ecef5a8f989753a5af55
[22:39:45] <jhubert> Essentially, I’m trying to use both count and distict to get some total numbers but am concerned about hitting the BSON object limits (or the group by 20k limit)
[22:40:26] <jhubert> My first pass just used direct distict calls for each number I want, but that seems like a rather inefficient way to do it and was curious if anyone else had a better suggestion.
[22:43:33] <joannac> brucelee: eventually any write will be at all your nodes. But it's not instant, replication is asynchronous
[22:48:11] <dberg2> joannac: yeah, that doesn't work. The problem stems from the fact that "$ne" is a post operator on a field. Ideally it would run the other way around. Like { "$ne": { a: 1, b: 2 }}
[23:15:44] <Ontological> Hey guys. I'm having a weird issue with GridFS. My files collection is called "files". If I do db.files.files.findOne({'_id': ObjectId("...")}) I am given a result. When I try to do files.get(ObjectId("...") I am told the file doesn't exist. Any suggestions?
[23:25:38] <joannac> (I'm not sure if that's what you're asking for)
[23:29:29] <in_deep_thought> joannac, I see .list() used on queries in serveral examples I find online. yet when I search docs.mongodb.org for documentation on .list(), I find nothing. What is .list() ?
[23:31:49] <ap_> If I'm trying to send data from mongodb to a neo4j database, can I use MongoConnector? https://github.com/10gen-labs/mongo-connector
[23:33:12] <in_deep_thought> joannac, go to the querying section in http://www.querydsl.com/static/querydsl/2.1.0/reference/html/ch02s07.html or line 37 of this: https://github.com/madhums/node-express-mongoose-demo/blob/master/app/controllers/articles.js
[23:35:22] <joannac> Oh, neither of those is the mongo shell
[23:35:59] <joannac> if you write your own layer, you can call your functions whatever you want
[23:37:02] <in_deep_thought> joannac, what do you mean? what layers are they using in this case?