PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Saturday the 9th of May, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:04:23] <GothAlice> They indicate the number of 4KB chunks being read from disk that weren't previously in memory.
[00:05:17] <StephenLynx> so its how often it needs to fetch data on disk?
[02:40:03] <ChALkeR> So does anyone know anything about debian stable packages?
[02:40:27] <ChALkeR> For mongodb-org
[02:40:44] <ChALkeR> Is it safe to use oldstable packages or are there any known drawbacks?
[03:16:04] <shlant> how do I test whether authentication is working on my replica set? I added users and can log in with them, but is there something I can try to make sure things require a login? should I be able to use the admin db without authenticating after creating users?
[09:21:48] <DragonPunch> how do you limit the amount of subdocs returned
[10:02:04] <DragonPunch> $set does not work with the aggregation framework. I'm being forced to use $addToSet or $push however, whenever I use addToSet or push it's encapsulating my data that I'm pushing or addingToSet into an array. When it's already an array. So it looks like a 2D array.. when pushed.
[10:02:16] <DragonPunch> Is there a cleaner way to simply $set in aggregation framework?
[10:06:22] <T-Sourcemaker> is it a bad idea to use a checksum index instead of a compound index?
[10:06:46] <T-Sourcemaker> for example I can use a sha1 checksum to create a unique _id field...
[10:07:21] <T-Sourcemaker> so that I always have a unique read and write access and in case of duplicates... I just remove and insert this document again
[10:17:13] <DragonPunch> T-Sourcemaker: i don't think you would have to worry about the compound index duplicating.
[10:17:48] <T-Sourcemaker> so using a compound index in better?
[10:19:32] <DragonPunch> T-Sourcemaker: Every index created has a cost at insert time of longer write locking or more work for background threads. 
[10:20:12] <DragonPunch> T-Sourcemaker: MongoDB can only use one index in any one query operation. Although MongoDB 2.6 has introduced index intersection, which allows more than one index to be used (specifically two indexes currently), there are a number of caveats on their use and one index, whether singular or compound, is still easier to manage and optimise around.
[10:20:50] <DragonPunch> So I would suggest, only to use it if you can make the MOST out of it. Don't use it to just use it. If you know you'll need it. If you're unsure. Don't use it.
[10:21:23] <T-Sourcemaker> DragonPunch: ok, I'm just asking because in the mongo I read, that using a check as index is a bad idea... and I should use a compound index in case I need multiple unique keys like in MySQL
[10:22:10] <DragonPunch> T-Sourcemaker: Not 'always'. They are just saying that so the noobs don't go doing stuff for no reason.
[10:22:22] <T-Sourcemaker> DragonPunch: ok thank you :)
[10:25:40] <T-Sourcemaker> It's an application where a lot of customers are having access and most of the data is stored for caching. So my idea is to create a simple SHA1 checksum to get the uniqueness (attributes of java classes) so I don't need to worry about compound indexese...
[10:26:27] <T-Sourcemaker> and the other possibility is to define the compound index... to make sure that there a no dups
[10:26:50] <T-Sourcemaker> because it's the first time I'm using this amazing database... I don't wanne make a technical failure :)
[10:33:38] <DragonPunch> T-Sourcemaker: You may not create compound indexes that have hashed index fields. You will receive an error if you attempt to create a compound index that includes a hashed index.
[10:34:27] <T-Sourcemaker> DragonPunch: In case of using a compound index... I don't need a hash
[10:34:43] <T-Sourcemaker> it's just a workaround to the a unique id
[10:35:06] <T-Sourcemaker> for example: Attribute A, B and C => SHA1 => _ID
[12:02:30] <xaxxon> if I have ad ocument with foo: {a:1} in it and I want to add another key/value to foo, can I append it somehow or do I hve to re-set it with both the existing ones and the new ones?
[12:02:47] <xaxxon> I want it to say foo: {a: 1, b: 2}
[12:21:43] <xaxxon> what'st h opposite of $addTpSet?
[12:21:53] <xaxxon> I don't see a $removeFromSet
[12:23:01] <xaxxon> pull..
[14:02:31] <tozz> In the Ruby 2.0 driver, is it possible to get the generated _id for a document created with insert_one() ? Before you always got it with .save() but I can't seem to find if it's possible in the new version
[14:07:03] <tozz> It was a classic "ask to find" question, found it in the docs :p
[14:07:36] <DragonPunch> what if I don't wnat to $addToSet as an array
[14:07:41] <DragonPunch> what if i just want to like $set
[14:07:47] <DragonPunch> the normal $set not workign for me
[14:48:22] <DragonPunch> okay seriously..
[14:48:24] <DragonPunch> how do i do it.
[14:49:02] <Zelest> The only way to win is to not play.
[14:53:13] <StephenLynx> whats up
[14:53:28] <StephenLynx> whats you issue, dragon?
[16:06:34] <DragonPunch> StephenLynx: yo
[16:06:46] <StephenLynx> yoo
[16:06:47] <DragonPunch> StephenLynx: it's Arcanine69 remember me?
[16:06:50] <StephenLynx> nah
[16:06:57] <DragonPunch> StephenLynx; i have u on skype
[16:06:59] <StephenLynx> ah
[16:07:09] <DragonPunch> ;)
[16:07:21] <DragonPunch> anyways, i don't know. im drawing my models and scehma
[16:07:24] <DragonPunch> on a big whiteboard
[16:07:30] <DragonPunch> so i can wrap my head around everything
[16:07:35] <DragonPunch> too much code for 1 person atm
[16:07:58] <StephenLynx> theres no such thing
[16:08:15] <DragonPunch> no su ch what
[16:08:24] <StephenLynx> if you have enough documentation, it will never be too much code.
[16:08:47] <DragonPunch> i have
[16:08:47] <DragonPunch> 0
[16:08:49] <DragonPunch> documentation
[16:08:51] <DragonPunch> i am doing it right now
[16:09:10] <StephenLynx> :v
[16:28:28] <insel> is mongodb the right choice to store "trees"? p.e.: id=1, value="a,b,c"; id=2, value="d,e,f" + id1; id=3 value = "g,h" + id2 ; id=4, value = id3+id2;
[16:28:44] <StephenLynx> that depends.
[16:28:49] <StephenLynx> on how you will query said trees.
[16:29:19] <StephenLynx> if you just want everything or they have a fixed structure then ok
[16:29:30] <StephenLynx> but if not, then you might be better with a graph db.
[16:30:05] <insel> have you an example for a graph db?
[16:30:25] <StephenLynx> never used one.
[16:30:37] <StephenLynx> wouldn't be able to give you better results than google.
[16:30:40] <StephenLynx> I just know they exist.
[16:30:44] <insel> :)
[16:49:59] <DragonPunch> StephenLynx: stephen, what do you think is the best way to store sensitive user data in mongo
[16:50:20] <StephenLynx> GothAlice I just found out the db object you get from the node.js driver is a connection pool :v
[16:50:35] <StephenLynx> DragonPunch what kind of sensitive data?
[16:50:52] <StephenLynx> if its password, hash
[16:50:59] <DragonPunch> in a seperate collection
[16:51:06] <DragonPunch> or a collection with all the other user informations
[16:51:08] <StephenLynx> it doesn't matter.
[16:51:13] <DragonPunch> right i was thinking the same.
[16:51:18] <StephenLynx> because permissions are set per database.
[16:51:26] <StephenLynx> you might want to use SSL
[16:51:29] <DragonPunch> i do
[16:51:37] <DragonPunch> wait ssl on the db?
[16:51:40] <StephenLynx> yes.
[16:51:41] <DragonPunch> i use i ton my web server
[16:51:44] <DragonPunch> it on*
[16:51:53] <DragonPunch> do i have to set it up seperate for the db?
[16:51:57] <DragonPunch> when making db calls?
[16:51:58] <StephenLynx> between the database server and application server.
[16:51:58] <StephenLynx> if they are not on the same place.
[16:52:05] <DragonPunch> db is seperate
[16:52:06] <DragonPunch> mmk
[16:52:09] <DragonPunch> yeah ill have to setup ssl than
[16:52:22] <StephenLynx> yeah, one might be able intercept traffic between them.
[16:52:26] <StephenLynx> improbable, but possible.
[16:52:30] <DragonPunch> which is fairly easy
[17:29:23] <DrTachyon> Hello
[17:29:40] <DrTachyon> Is anyone here?
[17:31:23] <StephenLynx> no, only us, trees.
[17:31:29] <StephenLynx> :v
[17:36:06] <benjick> Hi. I'm trying to run mongorestore -h localhost:27000 -d infoscreen -u infoscreen -p MYPASSWORD but I get auto failed. I've tried resetting the password a new times with mongo MMS
[17:38:31] <benjick> auth failed*
[17:47:29] <DrTachyon> Haha
[17:47:33] <DrTachyon> I need a little help..
[17:48:07] <DrTachyon> I'm making a financial app, and I'm storing the main ledger in a collection called (surprise) ledger
[17:49:07] <DrTachyon> The ledger contains transactions {account: string, refAccount: string, amount: number, credit: boolean}
[17:51:42] <DrTachyon> How do I display an account's balance.. i.e for all documents where account==="Adam"
[17:53:00] <DrTachyon> console.log(summation amounts (where credit===true) - summation amounts (where credit===false))
[17:57:45] <StephenLynx> db.ledger.find({account:'Adam',credit:true})
[17:57:58] <StephenLynx> will return all documents where credit is true and belong to adam
[17:58:02] <StephenLynx> DrTachyon
[17:58:48] <StephenLynx> tbh, I would store the balance on the account itself.
[17:58:58] <StephenLynx> instead of piece it together everytime
[17:59:22] <StephenLynx> you could also use aggregate
[17:59:29] <StephenLynx> and put a group stage
[18:00:19] <StephenLynx> {$group:{_id:1, $sum:{'$ammount'}}}
[18:00:32] <StephenLynx> it would give you the balance of all operations
[18:00:57] <StephenLynx> wait, that is wrong
[18:02:00] <StephenLynx> check the group docs, is not hard though
[18:02:09] <StephenLynx> I jsut don't use it often
[18:04:32] <DrTachyon> StephenLynx: I would do that, only, there's a lot of transactions going on in the application and I don't want to pollute the Users collection
[18:05:08] <DrTachyon> I need to be able to transfer amounts between users as well
[18:05:30] <StephenLynx> it seems you need a relational db.
[18:05:36] <StephenLynx> that supports transactions and stuff.
[18:06:13] <StephenLynx> do these number can't be wrong at all under any circumstance?
[18:23:54] <benjick> anybody know about my problem above?
[18:31:51] <shlant> anyone using mms agent in a container?
[22:17:47] <DragonPunch> StephenLynx: How do you do the documentation to your SChema/Models
[22:20:03] <StephenLynx> I just write it.
[22:20:14] <StephenLynx> and code along what I wrote.
[22:26:32] <boboc> guys i'm new to mongodb and i would like to know if it is possible to have a many to many relation and what's the best way to do that?
[22:30:20] <timg__> boboc: the short answer is no.
[22:30:32] <timg__> boboc: you can inline the data
[22:31:34] <boboc> timg__: it doesn't work to create a 3rd document like in rel dbs? with the other 2 document's ids?
[22:31:56] <boboc> timg__: or that will create a big overhead to the queries?
[22:32:38] <timg__> boboc: you can store document id's but there is no native way to join documents in mongo.
[22:32:45] <cheeser> you *can* do that. you just can't join across them
[23:58:41] <StephenLynx> how do you usually read the stats from gridfs?
[23:59:03] <StephenLynx> I need to check if the file was modified after a given date.
[23:59:12] <StephenLynx> to return a 304 code.