PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Wednesday the 6th of March, 2019

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[08:31:29] <jackjohn> Hey, anyone know how to add readonly access to mongod in 3.4.16
[08:31:55] <jackjohn> i tried this but didn't worked db.createUser({user: "readonly", pwd: "password", roles:[{role: "read", db: "db_name"}]})
[15:37:16] <ALowther> What is the default user for the mongo process? I had to create the /data/db directory on my Mac and I'd like to give permissions for the Mongo user to write, but it doesn't appear to have mongo in the name.
[20:52:40] <zergov> Hi, is it normal that my objectIDs's timestamp are now set to 0s? It started happening on our prod servers on march 1st, on some collections.
[23:11:20] <kba> I have a collection with users and sessions (userId, sessionId). I then have another collection with operations, let's say (ops, sessionId). I want to basically do a left join, i.e. get out all actions from a specific userId.
[23:11:59] <kba> I understand I need an aggreation, match/group/lookup, I presume. I'm starting out small with just a match on the userId, that works.
[23:12:11] <kba> A query with just ` $match: { userId: 'kbadk:github' },
[23:12:33] <kba> To my sessions collection returns everything matching my userId.
[23:13:07] <kba> When I create a query with just group, I can also group everything up: $group: { _id: '$userId', sessions: { $push: '$sessionId' } }
[23:13:59] <kba> That gives me back an object for each user in the collection and their sessions. I just want it for the user I'm currently querying for, so I try to combine the two components, the match then the group, but MongoDB will have none of it
[23:14:31] <kba> This: { $match: { userId: 'kbadk:github' }, $group: { _id: 'se', sessions: { $push: '$sessionId' } } } gives me: ";A pipeline stage specification object must contain exactly one field."
[23:14:45] <kba> Can anybody clue me in as to why that is?
[23:15:26] <kba> (woups, it of course says { _id: '$userId', sessions: ... } in the $group query)
[23:19:58] <kba> Oh damn it, match and group has to be passed in as objects in an array [ { $match: ... }, { $group: ... } ], not as { $match: ..., $group: ... }. I suppose that makes sense as they're ordered.