PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Saturday the 19th of December, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[01:35:37] <serversides> Hey everyone, can anyone tell me why this cmd isnt working? db.createUser({user: "username", pwd: "pwd", roles: ["readWrite"]})
[01:36:48] <StephenLynx> what error it gives you?
[01:37:07] <serversides> It returns, TypeError: Property 'createUser' of object nodebb is not a function
[01:38:14] <StephenLynx> where are you trying that?
[01:38:57] <serversides> because I want to create a user, so the nodebb installer can connect to mongodb
[01:39:08] <StephenLynx> what is nodebb?
[01:39:24] <StephenLynx> where are you running that command?
[01:39:25] <serversides> For some reaosn install mongodb in ubuntu 14.04 is an absolute nightmare. I have reinstall so many times and can only start with sudo service mongodb start. Sudo service mongod says its starting then fails right away
[01:39:53] <serversides> I have ran mongodb, then in another shell I have typed in mongo to open the mongodb console
[01:40:01] <StephenLynx> ok.
[01:40:47] <StephenLynx> which version you installed?
[01:40:59] <serversides> the lastest, once sec
[01:41:28] <serversides> db version v2.4.9
[01:41:37] <StephenLynx> no, the latest is 3.2
[01:41:55] <StephenLynx> it is possible 2.4.9 doesn't have the command you are trying to use
[01:41:56] <serversides> hmm, I followed this guide https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-14-04
[01:42:29] <StephenLynx> https://docs.mongodb.org/v2.4/reference/security/
[01:43:00] <StephenLynx> in 2.4 you have "add user"
[01:43:27] <StephenLynx> you should've used https://docs.mongodb.org/v3.2/tutorial/install-mongodb-on-ubuntu/
[01:43:45] <serversides> thanks Stephen, whats the best to update?
[01:43:49] <StephenLynx> and if I were you, I wouldn't use ubuntu at all for a server. I would use centos.
[01:44:01] <StephenLynx> ubuntu isn't supported on its latest versions, unlike centOS
[01:44:02] <serversides> StephenLynx: why centOS?
[01:44:14] <StephenLynx> not only 10gen supports it better
[01:44:20] <StephenLynx> but it is focused on being a server distro.
[01:44:25] <StephenLynx> ubuntu focus is desktop
[01:44:46] <StephenLynx> yum is a much better package manager too
[01:45:05] <serversides> Thanks for the advice. Been using Ubuntu for years, always stuck with it because I knew it better
[01:45:53] <serversides> I know a lot of shared web hosts use CentOS, which makes sense from your above statement.
[11:53:22] <ren0v0> Hey, i have profiling enabled on my database, and i have some slow queries there that i'm trying to improve. I've added indexing and now when i run a query from shell the are down to 10ms (from 200ms). However, i'm still getting the slow queries logs to system.profile.... They are 200ms in the logs, but if i run the exact query from shell its only 10ms ?
[11:57:07] <ren0v0> turns out i was looking at old logs like a dumbass :D
[11:57:24] <ren0v0> What else would cause high CPU with mongo, if i now have no slow queries?
[12:03:52] <ren0v0> i'm performing 40op/s
[12:07:45] <ren0v0> Sat Dec 19 12:02:05.478 [conn6] getmore minute_data query: { ts: { $gte: -6014433504 }, cc: "BTCGBP" } cursorid:264953715409281 ntoreturn:0 keyUpdates:0 locks(micros) r:324365 nreturned:9881 reslen:385379 324ms
[12:45:33] <kenju254> Hi anyone who can help me figure out a query i am trying to do for my database using Pymongo
[12:47:39] <PedroDiogo> ey everybody
[12:48:16] <kenju254> Hi PedroDiogo
[12:48:24] <PedroDiogo> haning problems logging in using mongo node.js official driver
[12:48:40] <PedroDiogo> getting AuthenticationFailed SCRAM-SHA-1 authentication failed, storedKey mismatch
[12:48:54] <PedroDiogo> when I'm pretty sure I'm using SCRAM-SHA-1
[12:49:09] <PedroDiogo> (tested with) db.system.users.find({user:"userHere"}).pretty()
[12:49:21] <PedroDiogo> and I can log in via mongo shell
[12:49:29] <PedroDiogo> will upload my code
[12:51:21] <PedroDiogo> https://pastee.org/kruce
[12:52:58] <PedroDiogo> the code is pretty simple and my server log does catch its attempt...but if fails "2015-12-19T12:37:47.946+0000 I ACCESS [conn7665] SCRAM-SHA-1 authentication failed for userHere on myDb from client 10.0.0.10 ; AuthenticationFailed SCRAM-SHA-1 authentication failed, storedKey mismatch"
[12:53:28] <PedroDiogo> (the uploaded coded might have some syntax erros as I was trying to hide some sensitive info)
[12:55:21] <PedroDiogo> I don't know whats happening and I dont know what else I can do... I've checked mongodb's driver version and it does work with SCRAM (v. 2.0.52) and my mongod's Replica Set v. is 3.0.7
[13:09:07] <PedroDiogo> any feedback would be much appreciated
[13:24:14] <Rashad> Hey.
[13:24:45] <Rashad> I am saving the _id of a document as an object that is like this: {"2": "2", "1": "1"}
[13:25:17] <Rashad> Why am I doing this? This document is a conversation between two users, and the _id is the user ids of both users.
[13:25:40] <Rashad> Ideally I'd want to store a set (orderless array).
[13:25:53] <Rashad> But since there are no sets in mongodb, I am doing this object thingy.
[13:26:34] <Derick> Rashad: better is to do { "to": 2, "from" : 1 }
[13:26:38] <Rashad> However, using mongo-express to view the database, I actually can have two separate documents each with one order of the object.
[13:26:41] <Derick> don't use an ID as key
[13:26:48] <Rashad> Key = ?
[13:27:12] <Derick> "2": « key
[13:28:01] <Rashad> My original question was: is this a mongo-express issue and in the actual database there is only one document, or is this a mongodb thing in which the object has order when it is stored?
[13:28:03] <Derick> but yes "can have two separate documents each with one order of the object"
[13:28:05] <Derick> that's correct
[13:28:14] <Rashad> I see.
[13:28:25] <Derick> as the whole embedded document (including order) is what the index indexes
[13:28:27] <Rashad> So objects are "orderful" in mongodb..
[13:28:30] <Derick> yes
[13:28:37] <Rashad> OK.
[13:28:37] <Derick> (when used as key)
[13:28:49] <Rashad> Now I am confused.
[13:28:54] <Rashad> When used as _id you mean?
[13:29:02] <Derick> no, when used as index key
[13:29:17] <Derick> _id needs to be unique, right?
[13:29:21] <Rashad> Yeah?
[13:29:44] <Derick> an index, builds a hash of a value - the value being (in this case), an embedded document with two fields
[13:29:53] <Derick> when building a hash of such a value, the order is important
[13:30:04] <Derick> if you would have a unique index on another field, the same applies
[13:30:41] <Rashad> OK.
[13:31:08] <Rashad> But you understand my problem here... I need to uniquely identify a "conversation" by the two correspondents or users.
[13:31:31] <Derick> yes, so a trick would be to always put the lowest user id first
[13:31:38] <Rashad> I guess I will just use another field called "ids" and then use one order only when updating the db.
[13:31:43] <Derick> so: { "user1": 4, "user2": 9 }
[13:31:56] <Derick> and never:
[13:32:01] <Derick> so: { "user1": 9, "user2": 4 }
[13:32:05] <Rashad> Yes.
[13:32:16] <Derick> i don't think you need a separate field though
[13:32:17] <Rashad> Why shouldn't I use _id for that?
[13:32:21] <Derick> you can
[13:32:23] <Rashad> Oh I see.
[13:32:27] <Rashad> OK thanks!
[13:32:31] <Rashad> Much appreciated :)
[13:32:37] <Derick> so: { _id: { "user1": 4, "user2": 9 }, 'field1' : 42 } …
[13:32:45] <Rashad> Yes.
[13:32:57] <Derick> why did you use "2" instead of "user1" (from my example)?
[13:33:22] <Rashad> For querying the db.
[13:33:29] <Rashad> But now I see I don't need that.
[13:33:32] <Derick> ok
[13:33:59] <Derick> it smelled badly... usually it is a bad idea to use a value (like I was seeing "1" and "2") as key
[13:34:25] <Derick> using descriptive names, like user1 and user2 is better
[13:34:51] <Rashad> Aha.
[13:37:26] <Derick> easier to document too
[13:49:54] <vak> hi all
[13:54:10] <vak> mongodb 3.2 doesn't want to list my databases created with mongodb 2.x using 'show dbs'. The pathDb and the permissions seem to be correct. Log file shows that mongodb detects some mmapv1 data, but nothing more... Any hint on how to access the old data?..
[17:46:18] <robsco> I'm currently using MySQL to do something I hope MongoDB will be faster at, any thoughts?... I load a temp table with around 10 columns of product data (name, price, description, etc), I then copy that data to another table, where duplicates are found, I set a "last_seen" datestamp, and also update an "updated" timestamp IF any of the columns actually changed. Since there's no real SQL needed, and I'm
[17:46:19] <robsco> dealing with 200m docs in total (in batches of around 30m), is MongoDB the clear choice?
[17:47:10] <robsco> I need to keep a track of when I haven't seen a document for X-days, so I can then delete those, and also need to record which docs actually get updated during each run
[19:37:22] <Rashad> Why is "each" deprecated?
[19:37:24] <Rashad> http://mongodb.github.io/node-mongodb-native/2.0/api/Cursor.html#each
[20:07:30] <Spynxic> Is anyone aware of a way to iterate over each item in an array without first loading the entire array into memory? (using pymongo)
[20:27:40] <Spynxic> Is anyone aware of a way to get the length of an array without first loading the entire array into memory? (using pymongo)