PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Thursday the 14th of March, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:01:16] <sinisa> http://docs.mongodb.org/manual/applications/update//#Updating-The%24positionaloperator
[00:01:48] <ins0mnia> cool thank you
[02:21:36] <SecretAgentX9> I have a question about Mongoose schema's. Is this an appropriate place to ask ?
[07:56:22] <abhinav> Hi guys, QQ. I am using mongoid alias like "field :n, :as => :name, :type => String"
[07:56:59] <abhinav> now when controller returns this data to one of the services as json
[07:57:21] <abhinav> as expected I get a response field as "n" and not "name"
[07:57:34] <abhinav> is there a way I can enforce this in return?
[08:33:14] <abhinav> Hi
[08:33:21] <abhinav> I am using mongoid alias like "field :n, :as => :name, :type => String"
[08:33:21] <[AD]Turbo> hi there
[08:33:27] <abhinav> now when controller returns this data to one of the services as json
[08:33:37] <abhinav> as expected I get a response field as "n" and not "name"
[08:33:44] <abhinav> is there a way I can enforce this in return?
[08:38:20] <abhinav> any clues here guys?
[10:19:37] <remonvv> \o
[10:50:44] <Nodex> AF
[10:51:07] <Zelest> almost friday? ;)
[10:51:28] <Nodex> yer
[11:39:52] <SirHirzu> anyone here with mongodb scaladriver(Casbah) knowledge?
[11:46:00] <SirHirzu> I have a very fundamental problem, when creating the MongoClient instance ( val mongoClient = new MongoClient() ) Ii complains about parameters, what kind of parameters do I need there?
[13:10:30] <Nodex> I want a horse meat burger
[13:23:54] <Nodex> http://images61.fotki.com/v545/photos/9/900497/5990888/whypeopleseemtohavefreetime-vi.png
[13:26:55] <modcure> bored?
[13:27:23] <Gargoyle> It seems to be missing "Bumming around on IRC posting pictures… Nodex"
[13:27:25] <modcure> :)
[13:38:07] <marcules> hi there :)
[13:41:24] <Nodex> lmao
[13:41:32] <Nodex> Lunch break :D
[13:48:59] <SrPx> Hello. Does mongodb have incremental views similar to couchdb? Like, indexing mapreduce operations (if I understood properly)
[13:49:19] <kali> SrPx: nope
[13:50:17] <SrPx> kali: so pardon but if I get it, mongodb is more similar to mysql with queries, but couchdb is faster if you prefer using mapreduce operations? Is that it?
[13:56:05] <kali> SrPx: this is kinda right. the thing is... i think couchdb introduced a lot of confusion by calling "map/reduce" what is actually materialized views
[13:56:45] <kali> SrPx: but we can safely say that mongodb has nothing that look remotely like materialized vied
[13:57:01] <kali> SrPx: and mongodb map/reduce is batch oriented. you can not use it for real time queries
[13:57:54] <kali> SrPx: you may want to check mongodb aggregation framework, it allows to solve quite nicely some of the problems that you can address with materialized views
[13:58:54] <SrPx> kali: I see! I've read some about it - it's the part that is kinda like SQL, right? Is there any reason it's faster than mapreduce?
[13:59:10] <kali> SrPx: yes. it's native code, no js
[13:59:31] <kali> SrPx: so no interpreter, and no mutual exclusion
[14:01:22] <SrPx> kali: also, I'm just learning about the view model. It looks really interesting. Say I'm storing 1k "players". I have a page that displays the ranking of players. I've been thinking about it... even if you dont know about it... Isn't the building of that page just a mapreduce of the list of players?
[14:02:39] <SrPx> kali: that is, first you select the interesting data (the player level and name)... then you reduce it (sort and create html rows)...
[14:02:43] <SrPx> kali: is that correct?
[14:03:38] <kali> SrPx: you're talking about the MVC model family, right ?
[14:03:49] <SrPx> kali: I guess I am?
[14:04:12] <kali> SrPx: i just mean... this is not mongodb specific
[14:04:49] <SrPx> kali: oh I see, sorry
[14:05:22] <kali> SrPx: it's not a problem, as far as i'm concerned, i just want to make sure we're not confusing materialized views (a db feature) with the "view" of the MVC models (a UI framework abstraction)
[14:06:15] <SrPx> kali: I probably am, I don't know anything about MVC and am just learning about materialized views, but I made the association, they seemed like the same concept pretty much
[14:06:18] <SrPx> :l
[14:07:13] <kali> SrPx: well, you can map them in some simple apps, or in simple parts of some apps
[14:07:55] <kali> SrPx: but in most circumstances, you need some logic between what your database provides and what your user will manipulates in the UI
[14:09:52] <SrPx> kali: yes and that's the controller part of the "mvc" , which would be, eh... mapreducing the data ... am I completely mistaken as I feel I am? u.u
[14:11:43] <kali> SrPx: controller receive commands from the user, interacts with the model (which itself interacts with the DB) then prepare a view to be rendered, or alter what is displayed in a view, the view present stuff to the user
[14:12:21] <kali> SrPx: that's the theory. it works well with 1980's apps, where you have keyboard and a screen :)
[14:12:23] <SrPx> kali: I get it but in pratice whats the controller? The backend program? The server?
[14:12:34] <SrPx> kali: ehh õo
[14:12:49] <marcules> hmm I guess I could also ask here: Is there a way to not only group by a single character but a range of characters? So for example I have a ranged group from a to d and want all my users whose Last Name starts with a, b, c, d in a group returned?
[14:13:12] <kali> marcules: with AF ?
[14:13:47] <marcules> erm... :D?
[14:14:11] <kali> SrPx: the MVC terminology will often exists at several levels: for examples, spring or ruby on rails use it to organize a web app
[14:14:29] <SrPx> uh huh
[14:15:00] <kali> SrPx: but you can also use it inside a "javascript app" that get pushed to a browser for heavy ajax applications
[14:15:17] <kali> marcules: aggregation framework
[14:15:20] <SrPx> hm
[14:15:46] <marcules> kali, I guess yes - but I'm not completely understanding it yet
[14:16:23] <kali> marcules: show me what you do
[14:18:31] <marcules> scheme: http://pastebin.com/AdjMXcMU usage: http://pastebin.com/RjYmSW6Z
[14:18:47] <marcules> At the moment I'm just getting all Users - not using aggregation
[14:20:54] <kali> irk, node
[14:21:22] <kali> marcules: you're basically slurping your user collection in node.js space. i can't help you there
[14:21:54] <marcules> hmm k, but I guess I'm not understanding aggregation in general
[14:22:20] <kali> marcules: look at mongodb aggregation framework
[14:22:32] <noverloop> so what's the timeline on 2.4 release?
[14:22:38] <marcules> I'm doing this right now
[14:22:38] <kali> medberry: and if you're a beginner, i strongly urge you to start something else than node.js
[14:22:52] <gazarsgo> ok so the mongodb cloudformation template starts off with a blank amazon AMI…would have been good to know :D
[14:41:46] <medberry> medberry is a beginner but suspects that was aimed at marcules
[14:42:20] <marcules> Tab completion strikes again ^^
[14:44:45] <kali> marcules: well, then stay out of node.js :)
[14:45:34] <marcules> hmm I don't think node.js is the problem - rather this is my first project with mongodb
[14:46:09] <kali> marcules: if you're already confortable with node, fine.
[14:59:49] <motiooon> hi all
[15:00:07] <motiooon> I want to create a replica set of 3 members
[15:00:16] <motiooon> 1 primary 2 secondaries
[15:00:44] <motiooon> if the primary goes down how do I ensure election without an arbiter ?
[15:01:00] <motiooon> let's say only 2 secondaries are left
[15:01:05] <kali> yes. 3 works without arbiter
[15:01:18] <motiooon> I've tryied so far to set priority 0 to one of them but doesnt seem to work
[15:01:30] <kali> because the two secondaries left will hold 66% of the votes
[15:02:00] <motiooon> but it doesnt elect
[15:02:08] <motiooon> they still remian secondaries
[15:02:10] <motiooon> both of them
[15:02:23] <kali> mmm weird
[15:02:32] <kali> can you show a rs.config() ?
[15:03:49] <kali> and a rs.status()
[15:04:01] <motiooon> https://gist.github.com/motiooon/5162042
[15:04:57] <kali> motiooon: i count 4 nodes in your RS
[15:05:07] <motiooon> https://gist.github.com/motiooon/5162053
[15:05:21] <motiooon> yes I've had to add one more because it didn't work with 3
[15:05:38] <motiooon> but the 4th it's unavailable
[15:05:47] <motiooon> so there are only 3
[15:05:50] <Derick> you should have an uneven mnumber
[15:05:53] <Derick> number*
[15:05:55] <kali> yes. two nodes out of 4 only hold 50% of the corum
[15:06:02] <kali> you can't get a majority
[15:06:07] <motiooon> so I should do 3 members
[15:06:13] <motiooon> ok I'll reconfigure to have 3
[15:06:29] <Derick> motiooon: having 4 doesn't gain you anything over 3 (but it doesn't hurt either)
[15:06:50] <kali> Derick: well, it does participate to the global warming.
[15:06:59] <Derick> wewll, yes
[15:07:09] <Derick> motiooon: you have one node with priority: 0
[15:07:21] <motiooon> yes
[15:07:26] <Derick> why? :)
[15:07:49] <motiooon> I thought that is the only way to elect primary with only 2 nodes
[15:07:56] <Derick> no no
[15:08:02] <Derick> don't try to outsmart it
[15:08:10] <Derick> (until you know how it really works)
[15:36:38] <motiooon> about this convention
[15:36:40] <motiooon> mongodb0.example.net
[15:36:41] <motiooon> mongodb1.example.net
[15:36:41] <motiooon> mongodb2.example.net
[15:36:58] <motiooon> I have this
[15:37:00] <motiooon> prod-mongodb02.ma01
[15:37:09] <motiooon> prod-mongodb03.ma01
[15:37:23] <motiooon> prod-dbanalytics01.ma01
[15:37:33] <motiooon> would this work ?
[15:37:48] <motiooon> prod-mongodb02.ma01.example.net
[15:43:03] <motiooon> does anybody know ?
[15:44:49] <capnkooc> hi guys, can someone please point me to the right direction on how to filter an array of objectIds with the timestamp store on the id?
[15:46:26] <capnkooc> I now how to do it using the object id of the document and filter the collection or a collection or objects but I really feel a little lost trying to do the same thing but with the objectIds inside an array
[16:11:49] <failshell> hello. does anyone have a backup tool/script for sharded clusters to recommend?
[16:46:24] <fommil> in the SQL mapping chart example, http://docs.mongodb.org/manual/reference/sql-aggregation-comparison/ what would be the mongo aggregation to get all the "item" entries as rows?
[16:46:42] <fommil> i.e. flatten an array into individual documents
[16:56:54] <fommil> $unwind !!! awesome
[17:46:02] <noverloop> anybody know when the 2.4 release is expected?
[18:00:27] <simon_> How can I verify that my three configservers know of each other and have the same data?
[18:13:29] <saml> you use scala?
[18:16:23] <joe_p> simon_: to see if you config servers have same data : use config; db.runCommand({dbHash:1})
[18:23:32] <simon_> joe_p: thank you!
[18:27:50] <Rakko_> hi there.. I am taking my first steps to mongodb and I was wondering if you gurus know about sharding.. I know that sharding key cannot be changed "on the fly" but is it possible to kind of reconfigure the sharding like shard A contains all the records between a: 0-100, shard B contains a: 100-200, shard C contains a: 200-300 so that after my changes shard A contains all record where a: 0-250 and shard B contains a: 250-300
[18:27:56] <Rakko_> and all this change, on the fly
[18:28:16] <Rakko_> does it make any sense what I am trying to do, to anyone ?
[18:57:37] <motiooon> hy
[18:57:41] <motiooon> hi all
[18:57:55] <motiooon> is there any way to bypass the naming convention for a replica set ?
[18:57:57] <motiooon> mongodb1
[18:58:00] <motiooon> mongodb3
[18:58:03] <motiooon> mongodb2
[18:58:34] <motiooon> my hosts have different naming conventions
[18:58:47] <motiooon> if I specify the hosts in the config file
[18:58:55] <motiooon> why do I have to follow any convention?
[18:59:07] <motiooon> they would know which host is who right ?
[19:00:27] <motiooon> is there any replica set deployment using puppet available out there ?
[19:00:32] <motiooon> anybody knows a good one
[19:00:33] <motiooon> ?
[19:01:39] <cookiem0nster> Trying to update mongo PHP driver to latest version, have been googling for a while and can't figure out the problem, can anyone help me out?
[19:11:16] <diminoten> what's a good way to estimate an upper end of capacity on a single mongodb instance
[19:11:27] <diminoten> I was going to calculate an "object footprint"
[19:11:42] <diminoten> like, I know the size of a single document, and I know that document will trigger other documents to be created, so the aggregate size of the created documents as well as the base document
[19:12:01] <diminoten> would constitute one object footprint, then divide the total available ram by this footprint value
[19:12:15] <diminoten> to get a sort of ballpark, order-of-magnitude value for what amount of data the app can handle before mongo performance tanks
[19:12:37] <diminoten> well not tanks, but grows larger than available ram, and... degrades
[20:06:37] <varunv> Hey, I am trying to optimize indexes for a collection, where I mostly only access data upserted over the last hour or so. The data format is like: {_id: ObjectId( ... ), url : "something", clicks: {ref1: <count>, ref2: <count> ..., } }.
[20:07:16] <varunv> {_id: ObjectId( ... ), time: ISODate( .. ), url : "something", clicks: {ref1: <count>, ref2: <count> ..., } }
[20:07:18] <varunv> Sorry added time
[20:08:25] <varunv> We retrieve the whole documents according to url and time. We have indexes on it, but it's too big to hold all of it in memory across all of the different datasets.
[20:08:50] <varunv> Can it be optimized so that it holds only the "recent" documents?
[20:21:27] <sinisa> in aggregation framework should one use $project{field:0, field:1} if wants only field 1 to be in stream?
[20:48:02] <ins0mnia> does $pull accept an array of values?
[20:49:28] <sinisa> http://docs.mongodb.org/manual/reference/operator/pull/
[20:49:56] <sinisa> reference man , why is it online? :)
[20:50:05] <sinisa> you are looking for pullAll
[20:50:46] <ins0mnia> sinisa: this is not what I'm looking for
[20:50:51] <ins0mnia> sinisa: I don't want to remove all instances
[20:53:59] <ins0mnia> sinisa: { a: "b", arr:[{a:1}, {a:2}, {a:3}] } <- trying to pull for example {a:1} and {a:2}, anyway will try to pass an array of elements to pull see if it works
[20:55:52] <sinisa> pullAll:[{a:1}]
[21:02:41] <therealkasey> is it possible/safe to increase the size of an existing production capped collection?
[21:05:34] <sinisa> copy it to new collection ?
[21:07:22] <therealkasey> is that a no sinisa? sure i could make a new collection, push the producers over to it, then wait until the consumers finished the old one, then move them over. but if it's possible to increase the size in place that would obviously be preferrable.
[21:09:59] <sinisa> kasey, dont know is it possible.. did you check the docs
[21:12:25] <therealkasey> the docs do not specify one way or the other. you can convert an existing collection to capped, which gave me a glimmer of hope. hoped someone in here had experience or knowledge of internals.
[21:13:55] <sinisa> im looking for answer about aggregation .. also its not clear in the docs, should I use $project:field:1 to get ONLY field 1 in the stream
[21:14:08] <therealkasey> jira answers my question: https://jira.mongodb.org/browse/SERVER-1864
[21:35:33] <motiooon> is journaling required for a replica set?
[22:01:01] <AAA_awright> Where am I supposed to go for information on the wire protocol and client development?
[22:06:50] <hjeong> hello all, first time IRC user
[22:07:54] <hjeong> not sure what the etiquette is here, but can I just start posting mongodb questions here?
[22:10:21] <nDuff> hjeong: Yes.
[22:10:33] <hjeong> Cool! thanks :)
[22:11:26] <strnadj2> etiquette is on the boundary healthy mind .)
[22:11:54] <nDuff> hjeong: ...trying to get people to volunteer to help before they've had a chance to hear your questions is poor form, so opening with questions first is generally much preferred. (And yes, thank you for asking).
[22:12:34] <hjeong> Thanks guys!
[22:30:44] <hjeong> I have Students collection. Students has a list of Meetings (embedded), ordered by the field Meeting.time. And I want to do a query to get all students whose last meeting time is before 9pm. I expected {"meetings.-1.time"} to get the last meeting in meetings array, but it didn't seem to work. How can I query on the last element in the array?
[22:41:51] <bgummadi> guys, can I download mongodb web shell?
[22:42:06] <bgummadi> like the one hosted on try.mongodb.org
[22:48:09] <bgummadi> I found this project on github but there is no activity