PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Thursday the 10th of December, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[06:46:42] <greybrd> hi there. upgraded to mongo-java-driver 3.0 have to disable the unwanted loggin. please help
[06:49:33] <greybrd> hi there. upgraded to mongo-java-driver 3.0 have to disable the unwanted logging. please help
[09:44:57] <av_> My document is like this: { "_id" : ObjectId("5667f50ab2bdad32cb729fa9"), "user_id" : 6, "viewers" : [ 7, 9, 4, 78, 89 ] } how do I find length of viewers with a single query? user_id is unique, so I will use that for filtering
[10:24:21] <grahamhar> something like db.myCollection.find( { $where: "viewers.length > 5" } );
[10:25:32] <av_> well I figured it out
[10:25:56] <av_> something like this: [{'$match': {'work_id': 6}}, {'$unwind': "$viewers"}, {'$group': {'_id': None, 'number': {'$sum': 1 }}}]
[10:34:11] <Derick> grahamhar: you need to take lots of care with using $where - it's really slow, and no index is used
[10:34:36] <Derick> av_: I'd recommend just storing the amount of viewers in your document too
[10:35:42] <StephenLynx> av_ I agree with Derick, you should pre-aggregate this value.
[10:37:04] <av_> will there be any race condition issue?
[10:37:13] <av_> if two processes are writing
[10:38:39] <Derick> not if you use $inc and $push
[10:42:39] <av_> cool, thanks!
[11:06:18] <synthmeat> so, yeah. how to get mongodb 3.2.0 on ubuntu 15.10?
[11:08:06] <Derick> you can just download the generic tarball for Linux, and I think the packages for 14.10 should work too
[11:08:38] <StephenLynx> omg, 3.2 is out
[11:08:55] <Derick> it's been for a few days ;-)
[11:08:59] <StephenLynx> :v
[11:09:10] <StephenLynx> I thought my repository would work
[11:10:17] <StephenLynx> https://docs.mongodb.org/v3.0/tutorial/install-mongodb-on-red-hat/ this page didn;t update though
[11:11:35] <synthmeat> Derick: yeah, looks like it works from trusty
[11:29:44] <OccamRazor> Hi, someone with experience with mongo, java and linux can help me?
[11:30:30] <Derick> OccamRazor: I don't, but it's better to just ask your question. If people know the answer, they'll reply.
[11:32:53] <OccamRazor> i have an unusual result when i do a "nestat", it shows a series of connection from java to mongo, and for each connection, a "mirrored one" from mongo to java. Is a correct behavior?
[11:42:22] <Derick> OccamRazor: can you pastebin the netstat?
[11:44:40] <OccamRazor> I've reduced the netstat to a single pair... cause are 780 similar more lines... - http://pastebin.com/EE0NK7XX
[11:46:15] <Derick> that's odd
[11:46:22] <Derick> though one is ipv4 and the other ipv6
[11:53:36] <OccamRazor> afaik the prefix ::ffff: is for an ipv4 address in an ipv6 space
[11:57:10] <Derick> sorry - true
[12:07:22] <AbuDhar> hey
[12:07:23] <AbuDhar> :D
[12:07:32] <AbuDhar> what should I call my column in my database? posted_time ? does it sound weird?
[12:07:38] <AbuDhar> it's the time when my reminder is posted
[12:38:38] <chevy> Is there a way to query complex document(with nested subdocuments) by some key and value which I dont know where it lays in structure?
[12:40:06] <chevy> for example I have docs in collections like {a:1} and {b: {a:1}} and I want to exceute a query which will return docs with pair {a: 1} somewhere id document structure.
[13:39:58] <OccamRazor> back
[13:50:21] <flok420> i'm trying to remove documents from a collection using pymongo: http://pastebin.com/CLvXEa73 Now the strange part is that this returns "None". I expected it to return a dict() with 'n' set to the number of deleted documents. what am i doing wrong here?
[14:17:31] <Gurpartap> … ”data":[{"$numberLong":"3091519643"},587372892,5.23689349e+08]} …
[14:18:06] <Gurpartap> This is what I’m getting in a mongoexport, for an array of twitter IDs (int64)
[14:18:23] <Gurpartap> Any clue why there’s a Float there?
[14:19:14] <cheeser> what's the type in the database?
[14:19:16] <Gurpartap> Consuming the same via my application returns proper int64s..
[14:20:32] <Gurpartap> Ruby’s “Integer” (using mongoid)
[14:21:03] <Gurpartap> Checking underlying type
[14:24:27] <Gurpartap> https://github.com/mongoid/moped/blob/1.4.0-stable/lib/moped/bson/types.rb#L40
[14:24:48] <Gurpartap> I believe it’s mapping to int32
[14:25:28] <Derick> Gurpartap: javascript doesn't do 64bit ints, so we use "extended" javascript to be able to export
[14:25:52] <Derick> that float, must also be a float in the DB
[14:26:05] <cheeser> that's what i'm thinking.
[14:26:17] <cheeser> if you need type fidelity use mongodump not mongoexport
[14:29:23] <Gurpartap> revisiting my findings..
[14:40:10] <Gurpartap> Derick, cheeser, https://gist.github.com/Gurpartap/f89cfa77e2ed23391100
[14:41:25] <Gurpartap> This document is only exporting out floats (unlike some other docs that print a mix of ints and $numberLongs)
[14:43:22] <Gurpartap> Probably ended up saving them with the wrong data type when they were inserted. Sounds about right?
[14:43:46] <Gurpartap> (shouldn’t mongo cli query also print them out in exponential form if they were floats though)
[14:44:19] <Gurpartap> (I can’t remember ever setting those fields to float)
[14:44:38] <Gurpartap> “By default, the mongo shell treats all numbers as floating-point values. The mongo shell provides the NumberLong() wrapper to handle 64-bit integers.” - https://docs.mongodb.org/manual/core/shell-types/#numberlong
[14:45:49] <Gurpartap> I just realized that the data type is actually BSON Array underneath, and I suppose mongodb is taking care of the type.
[14:46:41] <Gurpartap> If I’m not wrong in my assumption, for arrays that don’t have any int64 member, it’s storing as floats (as the link also indicates it should do)
[14:49:43] <Derick> 14:38 <Gurpartap> Probably ended up saving them with the wrong data type when they were inserted. Sounds about right?
[14:49:47] <Derick> yes
[14:50:28] <Derick> it depends on the drivers though... they usually handle float, and int32/int64, according to the language
[14:52:01] <Gurpartap> Thanks Derick, cheeser!
[14:52:09] <Gurpartap> :)
[16:57:18] <kegster> So I read that mongodb is non-relational?
[16:57:38] <kegster> Is there any way to create relationships in mongo? seems to be the go to for js stacks, but not sure what i'd be losing
[16:58:23] <cheeser> denormalization is the recommended approach when it's feasible. that's kinda the point of a document store.
[16:58:52] <cheeser> https://docs.mongodb.org/manual/data-modeling/
[17:07:04] <kegster> xhmm
[17:07:16] <kegster> so would it not be good to use say postgres with node.js/express apps?
[17:09:11] <kegster> i'm just about to tinker with js apps and curious on why to use mongo vs postgres
[17:09:36] <kegster> a buddy said he NEEDED relationships in the database-- so mongo def would not be a choice for him?
[19:04:56] <lijeesh> hello guys, I need some help with mongos. In my sharded cluster, mongos frequently fails during peak connections. Following is the error message:
[19:05:00] <lijeesh> [mongosMain] pthread_create failed: errno:11 Resource temporarily unavailable
[19:06:02] <lijeesh> I run mongos in a server with 2 x octa core processors and 64GB memory
[19:06:17] <lijeesh> Following is ulimit
[19:07:01] <lijeesh> core file size (blocks, -c) 0
[19:07:08] <lijeesh> data seg size (kbytes, -d) unlimited
[19:07:14] <lijeesh> scheduling priority (-e) 0
[19:07:18] <lijeesh> file size (blocks, -f) unlimited
[19:07:23] <lijeesh> pending signals (-i) 63545
[19:07:28] <lijeesh> max locked memory (kbytes, -l) unlimited
[19:07:35] <lijeesh> max memory size (kbytes, -m) unlimited
[19:07:40] <lijeesh> open files (-n) 999999
[19:07:44] <lijeesh> pipe size (512 bytes, -p) 8
[19:07:49] <lijeesh> POSIX message queues (bytes, -q) 819200
[19:07:53] <lijeesh> real-time priority (-r) 0
[19:07:58] <lijeesh> stack size (kbytes, -s) 65536
[19:08:03] <lijeesh> cpu time (seconds, -t) unlimited
[19:08:07] <lijeesh> max user processes (-u) 500000
[19:08:08] <cheeser> you should a pastebin for things like that.
[19:08:24] <lijeesh> sorry
[19:08:27] <lijeesh> I will do it
[19:09:32] <lijeesh> http://pastebin.com/03rY473e
[19:09:42] <lijeesh> above is the ulimit
[19:09:51] <lijeesh> Anyone experienced this error before?
[19:15:18] <cheeser> not me
[19:17:52] <lijeesh> Btw I am using mongo 3.0.7
[20:13:21] <troypayne> is it possible to apply logic written in javascript to an Aggregate call? I want to return stuff based on some basic logic, and THEN limit
[20:14:00] <troypayne> right now i’m doing this so called basic logic, after returning the limited data set, and i need to analyze the whole
[20:20:29] <troypayne> i guess it’s called an aggregate stage. where this stage would be javascript
[23:22:29] <Nyterax> meteor up fails to install mongodb on ubuntu 15.10 (log: http://pastebin.com/4TjnaFfk ) anyone?
[23:53:04] <joannac> Nyterax: install it manually?