PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Sunday the 2nd of August, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[01:16:22] <pylua> could I make replia just through coping data files ?
[01:17:38] <cheeser> for the initial seed?
[01:18:17] <cheeser> like so? http://docs.mongodb.org/manual/tutorial/resync-replica-set-member/#replica-set-resync-by-copying
[03:21:45] <Kom> I am coming here because of a scenario I can't quite overcome here with a new MongoDB installation, wherein an account that I created and can authenticate with locally, fails authentication when a remote connection is made. Any advice or resources on why this would be happening?
[16:01:44] <carver404> while using minimongo, i'm getting a "Uncaught error: Base needs _id".. any pointers?
[16:03:04] <cheeser> you'd have to ask the meteor guys.
[16:04:11] <carver404> cheeser: alright! actually i pinged on #meteor but no response yet. so thought someone here might know
[16:05:04] <carver404> cheeser: though the syntax for updating a minimongo is same as mongodb right?
[16:06:14] <cheeser> i don't know much about it.
[16:06:29] <carver404> cheeser: okay, np
[17:45:47] <tiblock> Hi. I want to make my first project with mongo. Is there security things that i need to know? Like SQL Injection in SQL?
[18:15:56] <dddh> tiblock: have you read books or worked with another nosql db?
[18:16:34] <tiblock> dddh, no, but i saw few exaples and its looks easy. I code in node.js and mongo is like JS based
[18:18:18] <tiblock> dddh, and currently i need database to store different JSON data, so mongo is very good solution i think
[18:20:51] <dddh> btw postgresql also supports json
[19:51:11] <dddh> tiblock: what kind of project? play with map reduce?
[20:13:16] <MacWinne_> is there a simple way to see what queries are hitting my mongodb and are not using an index? Assuming I don't have access to the source code that is making the calls
[20:13:50] <MacWinne_> I'd like to report back to dev that a specific query is doing a full table scan and give them an example of the query causing it so they can fix
[20:13:59] <MacWinne_> or so I can create an index if needed
[20:14:14] <MacWinne_> maybe using MMS?
[20:44:06] <mc_teo> Hey, first time using MongoDB and looking for some quick help (more DB admin, than mongo specific tbh). Say I have 3 collections, based off these http://pastebin.com/Jjxae1Z8 ; I want to try add something like a "read" status to each post, but unique to each user (so users can see all unread posts later). Seems very relational, but is there any nice eloquent way to do it in Mongo?
[20:44:46] <StephenLynx> a field holding a boolean indicating it was already read.
[20:44:56] <StephenLynx> ah
[20:44:57] <StephenLynx> hold on
[20:45:17] <StephenLynx> you will have to duplicate information there.
[20:45:19] <mc_teo> My approach was to add a read status to the post, and then just add an array of these to each user, but that means each user has a list of every post
[20:45:37] <StephenLynx> or a list holding all read posts.
[20:45:48] <StephenLynx> but
[20:45:58] <StephenLynx> an array on the post would be more manageable.
[20:46:17] <StephenLynx> because an account can be active for years and years, but posts usually lose attention after a day or so.
[20:46:36] <StephenLynx> so the array of users that read the post wouldn`t grow up so much.
[20:46:42] <mc_teo> but the query for unread posts would have to hit every post, and check is the user._id in the posts array
[20:47:24] <StephenLynx> mongo can check that, afaik.
[20:47:40] <StephenLynx> and filter documents that contain a given value in an array.
[20:47:55] <horsey_> Hello, is it possible to update specific fields of a single array element of a sub-document with a single Mongo query?
[20:48:13] <StephenLynx> yes.
[20:48:27] <StephenLynx> you can either specify the index of the element to be updated
[20:48:46] <StephenLynx> or use $ as a wildcard for a matched element in the array on the query.
[20:54:04] <horsey_> StephenLynx: So if I use the $set key word with a JSON string having the updated fields, will that suffice?
[20:55:41] <StephenLynx> yes
[20:55:58] <horsey_> https://gist.github.com/horsey/c3f96f103b4477e250f3 <-- LIke this?
[20:56:02] <StephenLynx> $set:{'array.$.field':value}
[20:56:54] <StephenLynx> seems right.
[20:57:03] <StephenLynx> but I haven`t messes with sub array in a while
[20:57:13] <StephenLynx> messed*
[20:57:36] <horsey_> Okay, not sure why but it fails.
[21:02:18] <StephenLynx> what error it gives?
[21:03:30] <horsey_> https://gist.github.com/horsey/be4e60f83e9c97c1fc4b
[21:03:53] <StephenLynx> print the document
[21:06:49] <horsey_> StephenLynx: https://gist.github.com/horsey/56eda78598bae18fd914
[21:08:12] <StephenLynx> first
[21:08:19] <StephenLynx> that is a mess
[21:08:38] <StephenLynx> I strongly suggest you create more collections
[21:08:59] <StephenLynx> second
[21:09:10] <StephenLynx> the elements of secretary are objects, not arrays
[21:09:14] <StephenLynx> so you can`t use addToSet
[21:10:13] <StephenLynx> if you wish to just change a field of the object in secretary, just use 'secretary.$.field': value
[21:10:18] <horsey_> StephenLynx: Sorry about the formatting.
[21:10:23] <StephenLynx> is not about the formatting
[21:10:30] <StephenLynx> is about the complexity of the document.
[21:10:44] <StephenLynx> the formatting is inconvenient too, use pretty() when possible
[21:11:46] <horsey_> So you're saying my code is inserting JS objects and not a JS array?
[21:12:27] <StephenLynx> no, your paste is saying that.
[21:12:54] <StephenLynx> "secretary" : [ {
[21:12:56] <StephenLynx> array of objects.
[21:13:08] <StephenLynx> so secretary.0 is an object.
[21:21:08] <horsey_> StephenLynx: http://docs.mongodb.org/getting-started/node/insert/: Going by this document, is "grades" an array of objects as well?
[21:21:46] <StephenLynx> yes
[21:21:55] <StephenLynx> insertOne( {
[21:22:02] <StephenLynx> it is inserting an object.
[21:22:14] <StephenLynx> { = object
[21:22:16] <StephenLynx> [ = array
[21:23:21] <horsey_> Okay, got ya!
[21:24:54] <horsey_> Can I update a bunch of fields in the object? I understand that 'secretary.$.field' will update a single field.
[21:27:03] <StephenLynx> just add multiple fields in the $set
[21:27:19] <StephenLynx> fieldA:valueX, fieldB: valueY
[22:05:57] <Lope> On my ubuntu machine I have mongodb 2.6.10. On my Debian Jessie (using wheezy build, it's the newest available) I have 2.4.10. When I do CRUD stuff inside the mongo terminal on 2.6.10 I get a status message after every command telling me how many matched, updated, modified etc. But on 2.4.10. It doesn't give any status at all. How can I see a status after every command?
[22:13:36] <Derick> Lope: you can't, that is new in 2.6
[22:16:07] <Lope> Oh, how can I run a newer version of mongo on Debian Jessie?
[22:21:18] <Derick> http://docs.mongodb.org/manual/tutorial/install-mongodb-on-debian/
[22:29:28] <Lope> Derick: I saw that. After adding the mongodb wheezy repo as that page recommends. I ran apt-get update && apt-get install mongodb
[22:29:44] <Lope> And 2.4.10 is what it gave me.
[22:30:31] <Lope> oops. meant to be mongodb-org
[22:30:44] <Lope> will sort it out tomorrow. thanks
[22:30:48] <Lope> night night
[23:56:53] <punnie> hey hey, getting some very weird errors after upgrading a replicaset
[23:56:56] <punnie> User Assertion: 11000:E11000 duplicate key error index: local.slaves.$id dup key
[23:57:26] <punnie> jira says is "benign", whatever a "benign error" means, but could that have any effect on consistent writes?
[23:58:36] <joannac> did you make some config changes or something?