PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Thursday the 5th of April, 2018

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[04:58:02] <yvear> for the `count of operations` here https://docs.mongodb.com/manual/reference/command/top is it the `count` since the server started?
[12:42:04] <psynor> hello. please excuse my ignorance. I am pretty new to mongo. I am setting up a replica set on v2.4 (application requires this old version). I would like to enable authentication. I did this fine for 3.6 for another project, but I am having a hard time doing the same with this 2.4. what I want to setup is a "root" like user with all privileges on all DBS, configs, RS config, etc. I would also like an application user with all priv
[12:42:04] <psynor> ileges on a specific DB.
[12:42:15] <psynor> so far, i believe I created the root user successfully, but I am not sure how i check the permissions of it. I authenticated to an instance using the admin authentication DB, and i did db.system.users.find(), which said "not master and slaveOk=false". I then tried to do rs.status to find the master, and got unauthorized.
[12:42:25] <psynor> so now im trying to see what privileges my active user has to see why im getting the errors
[12:47:22] <Derick> I'm afraid I don't know the answer to this.
[12:48:06] <Derick> I would recommend you write to the mongodb-user google group: https://groups.google.com/forum/#!forum/mongodb-user
[12:59:13] <jindraj> Hi. According to MongoDB PHP Driver info site the driver version is recommended. Will older driver version mongodb-1.1.9 work with MongoDB server 3.6.3? Are there any changes in protocol? or newer versions of driver fixes bugs + adds support for new mongodb features?
[13:02:39] <Derick> jindraj: it will mostly work, but we can't guarantee it. There *are* changes in the protocol. Newer versions fix bugs and add support for new MongoDB features too
[13:02:47] <Derick> why is it a problem to upgrade?
[13:10:10] <jindraj> it is no problem to upgrade. But upgrade mongodb is easier for me than upgrading the driver
[13:10:22] <jindraj> Derick: thanks for info.
[13:14:25] <jindraj> The'
[13:23:49] <Derick> I would really upgrade the driver to the latest version too
[15:05:02] <jindraj> I will.
[15:26:58] <yvear> for the `count of operations` here https://docs.mongodb.com/manual/reference/command/top is it the `count` since the server started?
[16:09:02] <littlekitty> hi I had to change my data model drastically
[16:09:06] <littlekitty> it looks like this now
[16:09:11] <littlekitty> https://www.irccloud.com/pastebin/wud6nFkt/
[16:09:32] <littlekitty> my question is will this work?
[16:09:32] <littlekitty> collection.update_many({'swap.$.deposit_adr': {'$in': list(_dict)}}, {'$set': {'swap.$.swapped': True}})
[16:09:49] <littlekitty> can I use the $ operator like that?
[16:13:05] <littlekitty> if a document's deposit_adr inside the swap array is key of a dictionary (.. the '$in': list(_dict)} ..part) I want to change the boolean of that item to True
[16:14:05] <littlekitty> I must be doing something wrong
[16:17:08] <littlekitty> do I need to use this instead?
[16:17:08] <littlekitty> https://docs.mongodb.com/master/reference/operator/update/positional-filtered/
[16:17:17] <littlekitty> $[<identifier>] syntax?
[16:20:37] <littlekitty> in combination with arrayFilters ?
[16:30:51] <littlekitty> I changed the method call to
[16:30:53] <littlekitty> collection.update_many({}, {'$set': {'swap.$[elem].swapped': True}}, {'upsert': False, 'arrayFilters': [{"elem.depost_adr": {'$in': list(_dict)}}]})
[16:31:06] <littlekitty> now it yells at me about upsert: TypeError: upsert must be True or False
[16:38:43] <lewix> hi
[16:38:52] <lewix> i havent used mongo for a while
[16:39:00] <lewix> its possible to store key names with space right?
[16:39:16] <Derick> yes, just no . or $
[16:40:50] <lewix> so i can use the string notation for it?
[16:40:59] <lewix> 'key 1': 'voila'
[16:41:10] <Derick> that should work, yes
[16:54:08] <littlekitty> I found one mistake I made
[16:55:00] <littlekitty> according to the pymongo api doc upsert needs its own argument (update_many(filter, update, upsert=False, array_filters=None, bypass_document_validation=False, collation=None, session=None))
[16:55:21] <littlekitty> but now I get TypeError: array_filters must be a list
[16:55:24] <littlekitty> but it is a list
[16:57:17] <lewix> thanks
[18:07:57] <littlekitty> wow what a hazzle but I think it works now with
[18:08:01] <littlekitty> db_client["admin"].command("setFeatureCompatibilityVersion", "3.6")
[18:08:33] <littlekitty> and collection.update_many({}, {'$set': {'swap.$[i].swapped': True}}, {'arrayFilters': [{"i.depost_adr": {'$in': list(_dict)}}]})
[19:22:21] <mutante> what are .bson files? binary json??
[19:23:00] <mutante> the files were created by running mongodump
[19:23:26] <mutante> how do i turn that into human readable files i can open in an editor
[19:25:37] <littlekitty> mutante: I thikn what you really want is export https://docs.mongodb.com/manual/reference/program/mongoexport/#bin.mongoexport
[19:25:46] <littlekitty> mongodump is meant for backups
[19:26:33] <mutante> littlekitty: thanks! i'll try. and there seems to be another script to convert bson to json
[19:27:07] <mutante> i have an application (rocketchat) that doesn't implement certain things like "list of channels user is on" so i need to dig in the DB manually
[19:29:11] <mutante> except with "dump" i don't need to know anything .. i just get EVERYTHING .. with mongoexport it starts with "error validating settings: must specify a collection" and i need to start figuring that out
[22:48:25] <svm_invictvs> If I have a document { _id : { "foo" : 1, "bar" : 1 } } can I index the _id.foo and the _id.bar ?
[22:48:53] <svm_invictvs> A stack overflow article leads me to believe no, but I don't know how old it is and I can't seem to find much in the manual either way