PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Saturday the 14th of February, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:20:34] <Jake_> Is there a way to increase the Index Key Limit on mongo or does 3.0 increase the default of 1024 bytes?
[01:26:04] <CrazyTux[m]> Hey guys I've a 'date' field I want to group by Ymd how can I accomplish this ?
[01:30:46] <Boomtime> http://docs.mongodb.org/manual/reference/operator/aggregation/group/#group-by-month-day-and-year
[01:31:33] <Boomtime> the example uses an existing date field in the documents and extracts the yeah, month, day to group by
[01:35:42] <CrazyTux[m]> Boomtime, what if I want to catenate the actual returned date. i.e. 20150201, 20150202 -> collection resutlts
[01:38:06] <Boomtime> i don't know of a way to do that, but you know a date is better right?
[01:38:25] <Boomtime> i.e it will consume less stored space and be far more flexible in queries
[01:38:39] <Boomtime> why don't you just keep it as a date?
[01:38:41] <CrazyTux[m]> Boomtime, lets say I had a collection of domains when each had a collection of files and I wanted to return the result catenated together, i.e. 20150201 -> result, right now its year => 2015, month => 02, day => 01 in the response.
[01:38:59] <CrazyTux[m]> Boomtime, it is a date but I want to catenate the return response.
[01:39:06] <Boomtime> you are confusing the purpose of the server
[01:39:30] <CrazyTux[m]> Boomtime, how so
[01:39:34] <Boomtime> the server is to store and retrieve data, it has operators for data manipulation purely to facilitate that task
[01:40:01] <CrazyTux[m]> Boomtime, I want the application to receive a formatted response of the result, i.e. in mysql I could do GROUP BY date(created) <- created being a DATETIME column.
[01:40:02] <Boomtime> you own custom display formatting can be done more easily, and appropiately, on the client
[01:40:31] <Boomtime> what you just described is exactly what you have already
[01:40:36] <CrazyTux[m]> So is it not possible to do what I am asking
[01:40:38] <Boomtime> you can group by date
[01:41:05] <CrazyTux[m]> No because the response is separated into month, day, year, even though the aggregate result is correct the response format is not.
[01:41:13] <CrazyTux[m]> I essentially want to simply catenate the Ymd
[01:41:18] <Boomtime> carry the date through
[01:41:30] <Boomtime> pick the first date in the group and use that field
[01:41:40] <Boomtime> it must be the same as the extracted fields, by definition
[01:42:06] <Boomtime> voila, one field, as a date in the return
[01:42:29] <fn_steve> hey, i had asked a question about node's native driver earlier but had to leave before anyone responded.
[01:42:56] <fn_steve> basically, the pool size in node's native driver is 5.
[01:42:56] <Boomtime> hi fn_steve, i did not see the question, please ask it again (although i do not know node very well)
[01:43:17] <Boomtime> huh, really? the default for most drivers is 100
[01:43:33] <fn_steve> yeah, documentation says its for legacy support
[01:44:08] <Boomtime> http://mongodb.github.io/node-mongodb-native/driver-articles/mongoclient.html#connection-pool-configuration <- you're right
[01:44:11] <fn_steve> when i connect to my local db, i see the five connections logged in my mongod terminal
[01:44:20] <fn_steve> but heres the weird thing
[01:44:29] <fn_steve> shortly after, it starts gaining connections
[01:44:59] <fn_steve> and so it goes from 6 connections, to 7 connections, etc until it reaches 9
[01:45:01] <fn_steve> and then stops
[01:45:18] <fn_steve> so i made a test application
[01:45:27] <fn_steve> where all it does is connect to the local db
[01:45:32] <fn_steve> its only 3 lines of code
[01:45:35] <fn_steve> and it still does it
[01:45:43] <fn_steve> so i dont know if its a bug with the native drive r
[01:45:52] <CrazyTux[m]> Boomtime, how would I return the first date
[01:45:56] <fn_steve> or if theres something that could be causing that
[01:45:58] <Boomtime> is it a standalone server?
[01:45:59] <CrazyTux[m]> Boomtime, applicable to the $group
[01:46:02] <fn_steve> yeah
[01:46:30] <fn_steve> and if i close the db connection, it closes the 5 connections from the pool
[01:46:31] <Boomtime> CrazyTux[m]: http://docs.mongodb.org/manual/reference/operator/aggregation/first/#grp._S_first
[01:46:37] <fn_steve> but the 4 others stay open
[01:46:45] <fn_steve> basically until i stop mongod
[01:47:08] <Boomtime> fn_steve: what happens if you stop your app?
[01:47:14] <fn_steve> it shuts the 5 connections
[01:47:18] <fn_steve> but the 4 others stay
[01:47:34] <Boomtime> it does not sound like they are from that client
[01:48:36] <Boomtime> what node driver version?
[01:49:16] <fn_steve> 2.0
[01:49:24] <fn_steve> the most recent 2.0.15, i believe
[01:50:35] <Boomtime> interesting.. i see no known bug like that
[01:50:58] <CrazyTux[m]> Boomtime, $group' => array('_id' => array('month' => array('$month' => '$created_at'), 'day' => array('$dayOfMonth' => '$created_at'), 'year' => array('$year' => '$created_at')) would I throw '$first' inside of the '$group' ?
[01:51:09] <fn_steve> im going to close everything i have running
[01:51:10] <Boomtime> can you try increasing loglevel to observe what those extra connections might be doing?
[01:51:16] <fn_steve> and make sure nothing is causing more connections
[01:51:59] <Boomtime> (have to go for a few minutes, bbs)
[01:52:00] <CrazyTux[m]> Boomtime, I'm getting an invalid operator $first
[01:58:51] <fn_steve> all right, i think it may have been some other program i was running
[01:59:12] <fn_steve> i was on a different network earlier, but i cant imagine that having an effect
[01:59:41] <fn_steve> im just glad it wasnt my program hah
[02:02:30] <Boomtime> hi, back for a moment..
[02:02:41] <Boomtime> CrazyTux[m]: $first should be in the $group stage
[02:03:01] <Boomtime> the page i linked should give an example
[02:04:42] <Boomtime> fn_steve: good to hear
[02:05:45] <fn_steve> how can i increase the logging, so in the future i can see more details?
[02:06:45] <Boomtime> http://docs.mongodb.org/manual/reference/parameters/#param.logLevel
[02:07:04] <Boomtime> set it to 1 to log all commands and queries (not just slow ops)
[02:07:25] <Boomtime> be prepared for a big log file - set it back to zero as soon as you are done with your test
[02:07:56] <Boomtime> set it to 5 if you don't like having spare hard-drive space
[02:13:00] <CrazyTux[m]> Boomtime, when I place it in $group it says unknown operator.
[02:13:57] <Boomtime> can you provide the JSON of your $group stage?
[02:14:22] <CrazyTux[m]> Boomtime, one moment
[02:17:02] <fn_steve> Boomtime: thanks for all the help.
[02:17:14] <Boomtime> :D
[03:12:10] <AnnaGrey> hello?
[03:13:56] <Boomtime> hi there
[03:24:53] <Nilium> I have chocolate beer
[03:24:56] <Nilium> Don't know how I feel about that
[03:25:36] <Nilium> Well, time to play with mongo 3, at least.
[11:17:01] <amr> i've got a 2dsphere index on a field and im running a $geoWithin $box query but it seems to be using COLLSCAN
[11:17:10] <amr> is there a way to give it a nudge in the right direction?
[11:18:50] <amr> if i try an explain on a $near query it seems to be better
[11:23:17] <Boomtime> http://docs.mongodb.org/manual/reference/operator/query/box/#behavior
[11:23:29] <Boomtime> "Only the 2d geospatial index supports $box."
[11:23:48] <Boomtime> this is because a box on a sphere doesnt really work
[11:24:47] <Boomtime> you could construct something similar with $geometry, be aware of the effect of great circles though
[11:29:12] <amr> ah man
[11:29:18] <amr> i obviously cant read
[11:29:20] <amr> thanks
[11:43:55] <izx> Is there any maximum size limitation for the database?
[11:46:24] <Boomtime> the size of your harddrive..?
[11:49:05] <Boomtime> http://docs.mongodb.org/manual/reference/limits/
[11:49:25] <Boomtime> izx: your OS or hardware is going to limit you before mongodb does
[20:27:05] <flok420> hi. I have a collection with keys. each key has an array of data. now i'm trying to add data to those keys. i tried http://pastebin.com/d7dCbYM0 but db.test.find() always returns nothing. python does not throw any exceptions
[21:22:32] <flok420> never mind, got it to work