PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Monday the 3rd of October, 2016

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:49:41] <sector_0> how do I add authentication to my database?
[00:50:01] <sector_0> does my my database need to be 'admin'?
[06:05:09] <munzmania> hi!. I have documents A referring to documents B . I want to get all As along with the related Bs . i there's a way to get them in one call . I am aware it's a documents database but i have to do it this way
[06:07:19] <munzmania> Anybody there!!!
[07:34:46] <jephsf> I'm trying to migrate our mongo data to a postgres database, i have modeled a db with 3 tables around my data. I need to now parse through each record in a mongo table and reformat the document data, I'm new to this dba thing, in my head, i would output a list of each uuid in the mongo table, and then write a script to loop thru the uuid's and get each record with that uuid, and then make an insert line and put that in a schema.sql dml file. then run all those
[07:39:35] <jephsf> thrwo me a friggin bone over here.
[13:52:46] <jayjo> if I'm using aggregate to $group by year and month on a date field, I then use count: {$sum: 1} to count the documents. How can I do a COUNT DISTINCT() like in SQL, where I only count distinct values of a field?
[13:53:44] <jayjo> I see one way of using two groups, where the first group is grouping on the field I want to be unique. is this the best way to do this? I have a db of > 100m documents
[14:01:13] <jayjo> for a collection siteEvents, I have db.siteEvents.aggregate( {$group : { _id : { year: {$year: "$_t"}, month: {$month: "$_t"}, person: "$_p" }, count : { $sum : 1} } )
[14:01:24] <jayjo> where _t is a date, and _p is a person identifier. That should do it, right?
[15:21:57] <spleen> Hello All
[15:22:47] <spleen> i run about 1000000 mongo command that way ==> mongo ip:27021 MyCommandFile
[15:23:37] <spleen> Is there a way to have some outout in order to know for example what line mongo shell is executing ?
[22:27:33] <jr3> hmm is updating an item in an array going to take 2 queries?
[22:34:17] <GothAlice> jr3: There are many scenarios under which it does not require two queries. All atomic update operations will work, for example, as long as you either know the index (e.g. {$set: {tags.4: "bob"}} — replace the tag at index 4 with "bob") or can $elemMatch the element to update and use the $ operator.
[22:34:48] <jr3> GothAlice: I'm trying: db.foo.update({"array.value" : 22}, {"$set" : {"array.$.text" : "blah"}})
[22:35:21] <GothAlice> The caveat with that type of update is that it will only update the first matched array element in each matched document.
[22:35:58] <jr3> perfect, there's only one element with the unique id
[22:36:27] <jr3> err I need to constrain to one doc also
[22:37:20] <GothAlice> Ref: https://docs.mongodb.com/manual/reference/operator/update/positional/ notably https://docs.mongodb.com/manual/reference/operator/projection/positional/#array-field-limitation
[22:37:29] <GothAlice> update_one
[22:37:51] <GothAlice> Pass in sorting configuration to control which one is updated, if multiple do occur.
[22:38:38] <zak_> hi, who do you use for x509 certificates? we use letsencrypt for our https stuff, but i read we can't get client certificates with them. i'm just setting up a replica set on aws, so we want the traffic encrypted
[22:43:13] <zak_> also not sure why the warnings about man in the middle attacks if the ip addresses of the nodes are well known