[00:22:50] <tylerdmace> Let's say that I want to give each user of my application the ability to set a custom MongoDB URI to allow for their own local datastores to power my application. The models I create in my ODM are tied to a connection but since every user will have their own connection, I need a way for my models to be shareable across all the different connections. Has anyone done something like this before? Any insight as to a good solution?
[00:26:38] <tylerdmace> Essentially I want to have an application that allows for a custom connection to be made on user login. As soon as they logout (or after an expiration period) the connection should terminate. But I'd like the same RESTful API I have built to apply to all these connections, no matter where they come from. I'm having a really hard time finding a solution to this particular setup.
[00:27:14] <tylerdmace> Each user has a profile where they can set a custom Mongo URI. If they dont' supply one, I want to connect to localhost. But if they do supply one, I'd like the connection to be made to that custom URI.
[01:57:44] <haole> where do I get a list of the support events in MongoDB's Node.js driver? like 'fullsetup' and 'close'
[08:02:32] <Folkol> Is it possible to configure a Mongo Client to be read only?
[08:19:55] <repxl> hey, whats up with safe:true does not work anymore ? ....
[08:59:00] <repxl> can i use in one update query $set and $addtoset at once ?
[08:59:28] <repxl> or i have to first create log data with $set and than another query to increase log data.
[09:00:04] <Zelest> I would help you if I knew the answer :)
[09:00:13] <Zelest> Instead if sit quiet in my cage to avoid off-topic chitchat. ;)
[09:02:01] <kali> repxl: safe:true has been replaced by the write concern enumeration, and safe:true has been made more or less the default
[09:03:12] <kali> repxl: $addToSet will create an empty array if there is none (and i suspect $push is closer to what you need that $addToSet)
[09:05:05] <repxl> kali i can create with $push the field:data structure i need and at the end increase some values like how many times they tryed to log ? or i have to create first the structure with $set and than $push for incement or add data ?
[09:06:00] <kali> repxl: i'm not sure i understand completely what you're asking, an example would help
[09:25:55] <repxl> kali this is how i create my log data "db.users.update({email:'test'}, {$set:{log_data:{log_attempts:0,attempt_date:'some_Date'}}})" however i want incement the log_attempts everytime the update runs and date.
[09:30:44] <kali> repxl: just calling $inc on log_attempts will do the right thing
[09:31:43] <repxl> kali hmm ok i will try somehow figure it out.
[09:32:14] <kali> really simple. replace set with push and you're done :)
[09:34:57] <repxl> kali "db.users.update({email:'test'}, {$push:{log_data:{log_attempts:0,attempt_date:'some_Date'}}, $inc:{log_data.log_attempts:+1}})" also why i can't navigate to the subdocument log_attempts by using "."
[09:48:46] <repxl> "db.users.update({email:'test'}, {$push:{log_data:{log_attempts:0,attempt_date:'some_Date'}}, $inc:{log_data:{log_attempts:1}}})" it tells me "ERROR: Cannot increment with non-numeric argument: {log_data: { log_attempts: 1 }}"
[10:44:28] <kali> DMANRJ: the aggregation framework will be faster than m/r if you can express what you need with it
[10:46:03] <DMANRJ> well, i need to manipulate items so it's a bit hard to do IF and such with aggregation framework
[11:46:23] <Sticky> jiffe: no I did not ticket the auth idea
[12:07:34] <duckk> how does a chunk growns beyond the specified chunk size?
[12:08:56] <duckk> wasnt mongo supposed to change the shard or create a new chunk when one has it's size reached?
[12:40:05] <duckk> I installed mongo but I don't have the "mongos" file. Did I miss anything when installing?
[13:11:09] <triplefoxxy> I'm use bulk operations that should operate on collection "foo", but they end up executing on "foo.collection". What's going on there?
[13:21:27] <Folkol_> Hello. Can I upload a javascript file to MongoDB from my Java Client, so that I can use a module defined in this file in a mapReduce-operation from the same java client? (To avoid duplication of javascript code, since I am using the same module from the browser).
[13:41:17] <StephenLynx> are you planning to get the function out of the database to execute it on the front-end?
[14:38:14] <kenITR> Hello, I have identified a portion of my application as suitable for Mongo, The rest is MySQL. Can these co-exist on the same box and if so is there a way to manage the memory allocation?
[16:06:40] <_bahamas> hello! what can I use (java) to discover the actual primary on a replicaset ?
[16:08:06] <cheeser> why would you need that? just write to the driver and it'll find the primary for you.
[16:08:41] <cheeser> the host(s) you give MongoClient are just a seed list. once the driver connects, it discovers the primary for you and tracks elections and primary changes transparently.
[18:41:24] <mrmccrac> the writes seem to be doing ok
[18:41:34] <mrmccrac> but yeah this listCollections cant ever get a lock it seems
[18:42:45] <mrmccrac> i can do a find() query okay no problems
[18:47:08] <tylerdmace> I could use some help figuring out how to correctly implement a Mongoose connection manager. Anyone familiar with Node + Mongo (and Mongoose) wanna take a look at this: http://stackoverflow.com/questions/28503464/writing-a-mongoose-connection-manager
[18:47:34] <StephenLynx> yeah, Ive been using mongo and node for a while.
[18:47:47] <StephenLynx> I wouldn't wipe my ass with mongoose.
[19:28:24] <tpayne> perhaps i can write a script to do it, by sorting, taking the first, and then looping through any that are less than, and removing them
[19:29:20] <GothAlice> Aggregate query $group on your unique constraint, ordered by _id in the direction you need with $first on the fields you want to keep, $out'd to a new, de-duplicated collection.
[19:29:38] <NoOutlet> There's no simple programmatic way to indicate a removal strategy when defining a unique index with dropDups.
[19:29:59] <NoOutlet> Exactly what I was going to suggest, Alice. :)
[19:32:03] <tpayne> GothAlice: can you help me write that?
[19:32:11] <GothAlice> Unfortunately not at the current time. :/
[19:41:26] <tpayne> this is the col. Simple 1 to many where a user can have many request tokens. But i'm changing it so they can only have 1 request tokens, the latest one
[19:42:15] <NoOutlet> Why not store the requestTokens on the user document?
[19:44:19] <NoOutlet> To answer your question (as opposed to questioning your solution), then the field you want to be unique sounds like it's the `guid` field.
[19:44:23] <tpayne> well, i want to keep them separate and i want to add an expiry col as well
[19:44:49] <NoOutlet> When you say expiry col, you mean column, not collection?
[19:45:26] <NoOutlet> I would still argue that keeping them separate needlessly complicates things.
[19:46:43] <NoOutlet> You can have a field on the user called "requestToken" that is a subdocument with a "token" field where the value is the token string and an "expiredOn" field which is a date.
[19:47:25] <NoOutlet> You wouldn't be able to set the "expiredOn" field as a TTL index, but you could verify that the token is valid when fetching it.
[19:47:46] <tpayne> even though mongoldb is a non relational db, i'm using it like one
[19:48:17] <allcentury> hi all - anyone using the Mongo Ruby Driver? We're trying to connect to a docker container on AWS with an exposed port but not having much success. MongoClient.new('IP', PORT, options). Does IP need to be mongodb://IP ?
[19:50:21] <NoOutlet> :-/ .... Well, my advice is to not use it like a relational db.
[20:07:00] <NoOutlet> When someone uses a request token, you're going to have to find that token and get the GUID for the user. Then, you'll need to make a separate find for the user with the GUID. This is two queries instead of using a single query to simply find the user by requestToken.
[20:07:38] <NoOutlet> Well, that use case is more descriptive of a session, so it may not be the actual usage of these request tokens since I don't know what you're doing really.
[20:10:35] <NoOutlet> But the main point is the same. You can't do JOINs, so why set up your data schema to require JOINs which you then need to implement in Scala when you can so easily embed in a subdocument?
[20:10:53] <tpayne> no flexibility with subdocuments
[20:11:11] <tpayne> a user is a user, subdocuments can't be shared
[20:11:40] <tpayne> of example i return a list of notifications, these notifications have who posted them, and some other stuff.
[20:11:54] <tpayne> it's made up of two documents, not one
[20:12:05] <tpayne> so a subdocument would mean duplicate data
[20:12:18] <tpayne> and if a user changes their name, now i have to manage all the subdocuments and change them too? gets nasty
[20:12:31] <tpayne> so relational db solves this, but now you have to join, however joins are complex and slow
[20:12:42] <tpayne> so using Scala, i can actually put different collections on different clusters
[20:13:01] <tpayne> since user is used often, i can put that on 4 machines
[20:13:07] <tpayne> and put requestTokens on 1 machine
[20:13:57] <tpayne> and since Scala allows me to build these complex models from many documents, non blocking, without slow join queries bogging down the machine
[20:14:49] <tpayne> and the code clarity is another great thing, which i value over speed. I figure there are other ways to improve efficiency than to write rigid code
[20:14:56] <tpayne> anyway that's my two scents on why i do it this way
[20:25:55] <tpayne> NoOutlet: this is how i ended up doing it btw: https://gist.github.com/troypayne/1e3ad1cb4e8d5a378333
[22:09:07] <fn_steve> hey, i was wondering if anyone could help me with an issue that's left me a bit confused.
[22:09:26] <fn_steve> i'm using the native mongo driver for node.js with a connection pool size of 5.
[22:10:11] <fn_steve> my application sets up the connection at start up and then shares the db reference, so there's only the single connection (well, 5 connections via the pool size)
[22:11:11] <fn_steve> however, the output from mongod on my local machine shows the connection size slowly increasing over time
[22:11:39] <fn_steve> after about a minute, it'll tick up to 6 connections
[22:11:49] <fn_steve> then a little while after, it'll go up to 7 connections
[22:12:08] <fn_steve> but it typically stops once it reaches 9 connections.
[22:12:27] <fn_steve> is this coming from my node.js app or is there something else going on here?
[22:23:51] <dbclk> how can I test if slave is talking to master?
[22:28:16] <doxavore> dbclk: in a replica set, you can run rs.status()
[22:29:22] <doxavore> so... according to the compact docs, disk storage is not released back to the system. is a repair (which requires 2x storage) and deleting _all_ the data and re-replicating it the only way to recover disk space? o.O
[22:32:08] <doxavore> or repair no longer uses 2x storage and just storage + 2Gb..