PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Thursday the 18th of October, 2012

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:00:58] <Notionwork> This is what the other lines say in the php error log:
[00:01:04] <Notionwork> Module compiled with module API=20090626
[00:01:09] <Notionwork> PHP compiled with module API=20100525
[00:01:17] <Notionwork> PHP compiled with module API=20100525
[00:01:24] <Notionwork> These options need to match
[00:01:29] <Notionwork> in Unknown on line 0
[00:02:15] <Notionwork> I am thoroughly confused here...
[00:02:36] <Notionwork> And I'd love to get mongodb up and running so I can do some awesome app development
[00:13:13] <Notionwork> So does anyone have any ideas?
[00:13:25] <Notionwork> As to why this might be occurring?
[00:20:04] <_m> Notionwork: You need to compile the mongo extension with the same version of PHP
[00:20:19] <_m> * module API as PHP was
[00:21:38] <_m> Quick google gives me this: http://stackoverflow.com/questions/2394532/apache-is-unable-to-initialize-module-because-of-modules-and-phps-api-dont
[00:21:57] <_m> Which should be enough to push you in the right direction,
[01:57:05] <Ephexeve> Anyone using mongo in Arch linux?
[01:57:08] <Ephexeve> I have some problems here
[06:40:51] <goracio> hello, can anyone help me with this ? https://gist.github.com/3910191
[06:54:03] <goracio> ?
[06:57:14] <finalspy> hi everybody, does anybody knows of a way to add a replica set to a mongo instance which hasn't been started with -replSet and without restarting it ? In other words create a replica set on running instances of mongodb ?
[07:30:51] <[AD]Turbo> hola
[07:37:11] <samurai2> hi there, how to unlock all shards at the same time in parallel? thanks :)
[07:46:55] <kali> unlock ?
[07:49:16] <tunnuz> Hi there, does anyone know if I can restore some databases from some .ns, .0, .1, … files?
[08:56:23] <samurai2> I mean lock
[08:56:29] <samurai2> wrong typo
[10:35:58] <Bartzy> Hi
[10:36:16] <Bartzy> I'm migrating some stuff using PHP, and using MongoInt64
[10:36:24] <Bartzy> Some smaller numbers are seen in the mongo shell as:
[10:36:30] <Bartzy> NumberLong(1818159883)
[10:36:44] <Bartzy> But bigger ones are seen as strings inside NumberLong: NumberLong("100001112653593")
[10:36:46] <Bartzy> Is that OK ?
[10:38:37] <plow> hi guys, I've got heterogenous data, ranging from say 1kb to 4mb per document, should I use gridfs or just a normal collection generally speaking?
[10:38:49] <plow> all json
[10:40:31] <NodeX> gridfs
[10:40:54] <Bartzy> NodeX: I know you've seen my question! :P
[10:41:42] <NodeX> :)
[10:41:47] <NodeX> define Ok?
[10:41:58] <NodeX> as ever your question is vague
[10:45:33] <plow> NodeX: why with such certainty?
[10:46:53] <NodeX> what do you mean?
[10:47:46] <plow> NodeX: you recommend using gridfs over a standard collection?
[10:47:55] <NodeX> yes
[10:48:08] <NodeX> do you need to query the json?
[10:48:32] <plow> NodeX: no
[10:48:38] <plow> so it comes down to performance
[10:48:57] <NodeX> ok so why pollute your index with more _id's it doesnt need?
[10:49:13] <NodeX> because that's what adding it to a normal collection will do
[10:49:47] <plow> will there be much of a performance cost using gridfs over a document for smaller docs?
[10:50:06] <NodeX> why would you think there would be?
[10:51:27] <NodeX> you;'re welcome LOL
[10:53:15] <samurai2> this is really confusing, it's said to do db.fsyncLock() before shutdown the mongod and do the backup, but if we do that, we can shutdown the mongod
[10:53:35] <samurai2> we can't shutdown the mongod
[10:54:05] <samurai2> then I need to do kill -9 the process id
[10:54:13] <NodeX> snapshot backup?
[10:54:25] <samurai2> mongodump backup
[10:55:08] <samurai2> actually this is the first time I do the backup on mongo sharded and replicated clusters
[10:55:12] <NodeX> where does it say this?
[10:55:38] <NodeX> shitting down the mongod will stop the mongodump from running as it connects to it
[10:55:46] <samurai2> http://www.mongodb.org/display/DOCS/Backups#Backups-Lock%2CFsync%2CandBackup
[10:56:15] <NodeX> "mongodump cannot be used in this locked mode. If this is a problem consider one of the other methods."
[10:56:18] <NodeX> LOL
[10:57:50] <samurai2> so what is the proper method to do the backup for sharded and replicated clusters? using snapshot?
[10:58:31] <NodeX> the method described in that doc allows you t lock the DB and use LVM to snapshot it
[10:58:38] <NodeX> then you unlock it and it will resync
[10:59:36] <samurai2> so first after I stop the balancer on mongos, I do mongodump --db config on one of config server machine, then after that
[11:00:02] <samurai2> I just need to connect to one of my secondary replica set machine
[11:00:35] <samurai2> then do what you're saying before, which is lock the db and use lvm to snapshot only to this secondary machine, is that correct?
[11:00:44] <NodeX> you'd be better off waiting for someone who does backups and things on shards - perhaps kali can advise if he is alive
[11:01:43] <samurai2> thanks :).
[11:02:18] <kali> am i being invoked ?
[11:02:40] <NodeX> samurai2 is wondering the best methods to backup replicasets / shards
[11:02:58] <kali> yeah, well, i'm just doing mongodumps on the collections i want backuped :)
[11:03:18] <NodeX> ^ that's bascaily what I do
[11:03:34] <kali> i don't care too much about consistency, my whole stack is designed to fail gracefully when something's missing
[11:04:55] <kali> anyway, if i need to use these backups, i'll have more pressing issues
[12:05:45] <kristaps> Is there a way to show the status of every member of a cluster (replicasets as shards) when connected to an appropriate mongos?
[12:22:01] <codemagician> Does anyone have an example code of using MongoDB with Zend Framework 2?
[13:29:56] <mcarroll> if I want to force our PHP application to connect to one specific mongo server that's part of a replica set, do you have to specify the replica set? or is it transparent to the application whether or not it's part of the replica set?
[13:30:59] <NodeX> you can give read preferences in the connect string
[13:31:15] <mcarroll> are they optional?
[13:31:42] <NodeX> http://www.php.net/manual/en/class.mongo.php]
[13:31:44] <NodeX> http://www.php.net/manual/en/class.mongo.php
[13:32:03] <NodeX> "$con = new Mongo("mongodb://{$username}:{$password}@{$host}");"
[13:32:48] <NodeX> on later drivers you can also do this
[13:32:48] <NodeX> http://www.php.net/manual/en/mongo.setreadpreference.php
[13:34:16] <mcarroll> my problem is that we're getting a "master not found" error. while we're fixing the replication, I want to point directly to the master (instead of the replica set)
[13:34:56] <mcarroll> by just specifying one server, can I bypass the replica-set?
[13:36:09] <NodeX> yes
[13:36:19] <NodeX> $host ;)
[13:36:28] <NodeX> dont point it at your mongos
[13:36:57] <mcarroll> ok, I'll try that
[13:36:59] <mcarroll> thank you
[13:37:20] <NodeX> no probs
[13:37:37] <aster1sk> Anyone know when to expect PHP Driver 1.3.1?
[13:37:46] <NodeX> 2014 :P
[13:38:13] <aster1sk> Grrrr
[13:38:28] <aster1sk> This is a huge blocker for my company https://jira.mongodb.org/browse/PHP-535#comment-176220
[13:38:40] <aster1sk> I'm happy at lesat I got a reply.
[13:39:18] <NodeX> can't you just set it in the host for that aggregate?
[13:39:25] <Derick> aster1sk: something we will be looking at, but at least we need to get 1.3 out first
[13:39:45] <aster1sk> I hear you and am very appreciative for all of your hard work.
[13:39:47] <Derick> however, you can ofcourse directly connect to a secondary (without marking the connection as replicaset)
[13:39:54] <NodeX> ^^
[13:40:14] <Derick> aster1sk: 1.3.0 first - we're hoping (fingers crossed) for rc1 tomorrow for that
[13:41:30] <aster1sk> Would this require using the depracated slaveOkay() ?
[13:41:50] <Derick> it's not deprecated on the cursor class
[13:42:33] <aster1sk> True, and that works beautifully, however unfortunately not with aggregate()->slaveOkay()
[13:42:41] <Derick> ah, good point :-/
[13:43:10] <Derick> the question is, does it perhaps just work? :-)
[13:45:30] <aster1sk> Derick: You lost me.. But I think for now I'll just use the find() and aggregate the result in PHP (ughh it feels yucky).
[13:46:06] <NodeX> I dont see why you cant connect driectly to your secondary
[13:46:12] <NodeX> directly*
[13:47:22] <aster1sk> NodeX: you're saying omit the array('replicaSet' => true) in the connection options and just supply the secondary host?
[13:47:41] <NodeX> "$con = new Mongo("mongodb://{$username}:{$password}@{$host}");"
[13:47:49] <NodeX> $host being the secondary
[13:48:24] <NodeX> if you can fire reads at it I dont see why you can't forer aggregations at it
[13:48:28] <NodeX> fire*
[13:48:35] <NodeX> (unless I'm missing somehting_)
[13:48:42] <aster1sk> NodeX: I'll give it a shot, but I'm pretty sure the driver will figure out who master is and php_mongo_connection_force_primary()
[13:49:00] <aster1sk> NodeX: Aggregation is a $cmd, they behave differently.
[13:51:39] <[raymond]> I'm trying to export a collection using: "mongoexport --db website --collection users --csv --out /tmp/users.csv" but I'm getting the error "assertion: 9998 you need to specify fields"
[13:51:46] <[raymond]> From the documentation it looks like I shouldsn't need to provide a field list, am I reading it incorrectly?
[14:24:44] <aster1sk> I'm considering writing a web based mongodb data model creation tool complete with query builder.
[14:24:58] <ron> omg
[14:25:04] <ron> you're awesome!
[14:25:34] <aster1sk> It shouldn't be too difficult with the js libs available to date.
[14:27:06] <aster1sk> NodeX: for basic usage / education I believe it will be a useful tool.
[14:27:26] <ron> is it going to be php-based?
[14:27:29] <NodeX> well yer for someone's opinion of how a model should look
[14:27:41] <NodeX> but your opinion and mine are different regarding different apps
[14:28:15] <aster1sk> ron: Yeah, most likely.
[14:28:22] <ron> hmpf.
[14:28:37] <Derick> you have heard of doctrine, right?
[14:28:54] <ron> doctrine?
[14:29:08] <NodeX> stear clear of doctrine
[14:29:10] <aster1sk> Derick: I have come across it in my research, yes - but it doesn't play nicely with our spaghetti framework.
[14:30:52] <Derick> NodeX: doctrine ODM, why stay clear?
[14:31:05] <Derick> (IMO, with MongoDB, you shouldn't need to use an ODM at all though)
[14:31:53] <NodeX> I dot see why someone would choose mongo say for performance then bloat the app out and slow it back down with doctrine or similar
[14:32:00] <NodeX> it's a lost concept on me sorry
[14:32:10] <aster1sk> ron: don't care for PHP? The output would be JSON so doesn't matter much what the tool uses to generate that.
[14:32:26] <NodeX> don't get ron started on php flaming lol
[14:32:43] <aster1sk> Perhaps I'll use flask then to keep ron happy.
[14:33:03] <remonvv> If ron is not available I'm willing to replace him on the PHP bash team!
[14:33:12] <NodeX> lmao
[14:33:22] <ron> haha
[14:33:24] <NodeX> ron is busy being helpful in #solr
[14:33:27] <NodeX> which is scary
[14:33:40] <aster1sk> PHP is just fine for personal home pages.
[14:33:57] <NodeX> there is nothing wrong with php period
[14:34:02] <remonvv> PHP is just fine for Facebook. I just don't like it
[14:34:03] <NodeX> as long as it's written properly
[14:34:05] <ron> aster1sk: well, I php is the only 'language' I don't respect.. but it's quite off topic for the channel so let's leave it be.
[14:34:13] <Aim> remonvv: just fine?
[14:34:19] <ron> remonvv: facebook doesn't *really* use php.
[14:34:29] <Aim> the guys of facebook did some evil tricks to get it working
[14:34:43] <aster1sk> ron: /join #ilovephp ;P
[14:34:45] <Aim> hiphop :)
[14:34:45] <NodeX> it's a compiled binary but it's still php
[14:35:12] <remonvv> The point I was trying to make is that it's not relevant what it's used for. The problem with PHP is PHP, the language.
[14:35:17] <Aim> NodeX: nothing wrong with php indeed
[14:35:23] <remonvv> Incorrect.
[14:35:23] <ron> it's compiled to c/c++ and they did it because php is crap, but again, let's leave it at that.
[14:35:26] <Aim> usually the problem is people using php for the wrong things
[14:35:32] <NodeX> +1
[14:35:43] <NodeX> each to their own imo
[14:35:48] <Aim> ofc :)
[14:36:00] <remonvv> Not really. There's not a single thing PHP does better than a suitable alternative. PHP is legacy, so is Java for example to a large degree.
[14:36:00] <aster1sk> Jimmies Status : Somewhat less rustled.
[14:36:19] <remonvv> People use it because people used to use it.
[14:36:21] <ppetermann> remonvv: so what language would you like to use?
[14:36:41] <NodeX> I think in the next week or 2 10gen are releasing via their PR people a press release about my company so I'll be sure to include lots about PHP in there just for ron!
[14:36:58] <Aim> +1
[14:37:09] <aster1sk> :) I wrote this tool in PHP to build my current project http://stats.dev.riboflav.in/app/issue_unique_visit
[14:37:23] <aster1sk> It's running at my house so quite slow, it's not mongo's fault.
[14:37:32] <NodeX> numbers for keys :/
[14:37:43] <aster1sk> Click around, I had to do it.
[14:38:51] <NodeX> nice looking app (graphs)
[14:38:55] <aster1sk> We're extremely write heavy and only Chuck Norris can upsert on positional, so I used the MySQL ID's as keys.
[14:39:04] <ppetermann> NodeX btw, hiphop is not really php.. its php code transformed to c++ and then compiled ;)
[14:39:05] <aster1sk> Thank you, highcharts are great.
[14:39:44] <remonvv> ppetermann, I use Java but that has similar issues of being somewhat vebose/outdated. I'd like to use something like Scala, Ruby, etc.
[14:39:59] <remonvv> Preferably something JVM based because I feel that's easily the most mature platform at this point.
[14:40:11] <NodeX> ppetermann : "Compiled but still php is what I said"
[14:40:14] <remonvv> I like language discussions. You can take either side and have valid arguments ;)
[14:40:22] <NodeX> i/e php used to write it then turned into whatever
[14:40:28] <aster1sk> Still playing language wars eh?
[14:40:29] <ppetermann> remonvv: ok, have fun.
[14:40:30] <ron> guys, please, let's stop this talk.
[14:40:43] <ppetermann> NodeX: its not php, its not php bytecode when compiled
[14:40:45] <Aim> remonvv: yeah indeed, someones taste is also important in choosing a language to code in :)
[14:40:49] <aster1sk> /mode +o ron
[14:41:00] <NodeX> ppetermann : I never said it was
[14:41:13] <remonvv> Aim. True, but it shouldn't ;)
[14:41:14] <NodeX> you assumed that's what I meant, when in actual fact I said it's compiled binary
[14:41:19] <NodeX> which is true
[14:41:29] <NodeX> a compiled binary*
[14:41:32] <Aim> but to sum this long discussion
[14:41:35] <Aim> PHP owns big time
[14:41:36] <remonvv> This....is....awesome!
[14:41:38] <ppetermann> NodeX: thats what you imply by saying its still php ;)
[14:41:44] <remonvv> You're all wrong except for me.
[14:41:49] <NodeX> it is still php when it's not compiled
[14:42:14] <ppetermann> except it doesnt support all things php supports ;)
[14:42:15] <remonvv> It's almost a religious argument. That comparison holds up because facts aren't a huge part of the discussion ;)
[14:42:31] <remonvv> C++ is the best language ever. Proceed.
[14:42:45] <NodeX> let's all agree that VB pwns all
[14:42:51] <NodeX> and leave it at that
[14:42:53] <aster1sk> NodeX++
[14:42:53] <Vile> remonvv: agreed :)
[14:42:58] <Aim> i think we can safely say that javascript is the future
[14:43:13] <NodeX> ppetermann has no-one to talk to now :P
[14:43:14] <ppetermann> seems i won.
[14:43:19] <Aim> hehe
[14:43:22] <NodeX> lol
[14:43:29] <Vile> Javascript can be written in C++ %)
[14:43:38] <remonvv> ppetermann. you don't understand internet discussion. We all won and we all lost. It's a matter of perspective.
[14:43:50] <Aim> huh?
[14:43:53] <aster1sk> That was a satisfying /clear
[14:43:53] <ppetermann> remonvv: i think that was exactly what i just demonstrated.
[14:44:01] <Aim> were we having a serious discussion?
[14:44:07] <remonvv> I disagree with you!
[14:44:11] <remonvv> I sincerely doubt it Aim
[14:44:15] <ppetermann> i ignore that you disagree
[14:44:25] <Aim> maybe we should change the topic
[14:44:28] <ppetermann> again.
[14:44:29] <Aim> what about vi vs emacs?
[14:44:40] <remonvv> i disregard you ignoring me and cast "Sudden Understanding" level 2 on you
[14:44:40] <ppetermann> vim > vi > emacs
[14:44:42] <NodeX> nano ftw
[14:44:50] <Vile> Aim: you forgot MS Notepad
[14:44:51] <ron> http://cdn.buzznet.com/assets/users10/funbobby/default/arguing-internet--large-msg-114407728999-2.jpg
[14:44:57] <Aim> ppetermann: agreed
[14:45:07] <Aim> MS notepad is the only editor i use under windows
[14:45:08] <NodeX> someone was ripping me for using nano the other day, was it in here or #nginx
[14:45:23] <Aim> nano is for people who are afraid to use vim or emacs :)
[14:45:31] <NodeX> nano is quick and simple
[14:45:56] <Vile> vi is also quick and simple, and runs everywhere (including QNX)
[14:46:21] <Aim> vi vi vi the number of the beast
[14:46:40] <NodeX> that new TV show looks good
[14:46:48] <NodeX> 666 park avenue with that guy from lost
[14:46:51] <NodeX> (as the devil)
[14:47:12] <NodeX> and the blonde one from Transformers 2
[14:47:14] <ron> I really don't like that actor.
[14:47:27] <NodeX> terry o'quinn I think is his name
[14:47:54] <Vile> Guys, do you know any hierarchical search engines?
[14:48:11] <NodeX> gonna have to be a bit more definitive Vile
[14:48:21] <NodeX> do you mean query pivotting?
[14:48:33] <NodeX> and or faceting
[14:48:46] <NodeX> and or facet pivoting for that matter
[14:48:59] <Vile> i mean fulltext search engine that can search hierarchy of documents not as a flat list
[14:49:41] <NodeX> I dont understand what a heirachy of documetns is
[14:49:54] <NodeX> sorry my brain is fried from arguing laguage semantics LOL
[14:50:31] <Vile> take file system. imagine that every folder can have some text content
[14:50:57] <NodeX> right but isn't that just a tree?
[14:51:08] <aster1sk> That's what it sounds like.
[14:51:14] <NodeX> and that tree can be represented as a document
[14:51:20] <NodeX> or each leaf of the tree*
[14:51:21] <aster1sk> Also I must add : dvorak > qwerty
[14:51:27] <Vile> task is to find a document based on a number of search terms, which can appear in the documnet itself or in the any of the folders above
[14:51:30] <remonvv> NodeX, argueing PHP is good -> brain fried
[14:51:38] <NodeX> remonvv : :P
[14:51:45] <NodeX> arguing*
[14:52:03] <NodeX> (I know it's not your native tounge)
[14:52:08] <Aim> ooh we are back at the os wars :D
[14:52:23] <NodeX> right I get it vile
[14:52:31] <ppetermann> so make your argument why it is bad, but please dont copy that horrible article that everyone is linking in the last half year when talking about php, cause half of it is factual wrong
[14:52:41] <aster1sk> Winning combo : debian, dvorak, vim, python
[14:52:53] <NodeX> Vile : I still dont see how you can't do that in a normal database
[14:52:58] <ppetermann> dvorak.. disgusting
[14:53:11] <Vile> NodeX: because of updates to the folders
[14:53:12] <aster1sk> ppetermann: nowai, it's 1337 my friend.
[14:53:29] <Aim> wooooooah
[14:53:33] <ron> fine. you forced me. http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
[14:53:34] <NodeX> and...
[14:53:42] <Aim> so getting a dvorak keyboard will make me really cool? :D
[14:53:54] <aster1sk> Aim: absolutely, the ladies just love it.
[14:53:55] <NodeX> if you update a folder why would you not update it's content in the database?
[14:53:56] <Vile> i.e. i can represent it as a flat list, which will include info from all the folders above for each of the documents and search that
[14:54:00] <Aim> aster1sk: i have to get one
[14:54:12] <Vile> BUT, if the folder gets updated...
[14:54:20] <aster1sk> Aim: what's more is using a qwerty physical keyboard with DSK.
[14:54:20] <NodeX> ron : that blog is a rant
[14:54:37] <NodeX> slating a language for bugs doesn't make it bad
[14:54:48] <Aim> aster1sk: must have!
[14:55:13] <aster1sk> Aim: I switched abotu three years ago, never looking back.
[14:55:14] <NodeX> Vile : I really dont see the problem
[14:55:54] <Vile> NodeX: imagine you have 1 000 000 documents, and the top folder updated every few seconds
[14:56:00] <NodeX> Unlike (literally!) every other language with a similar operator, ?: is left associative. So this: <---- in no language should you EVER stack tenery operators - this guy can't even write good code
[14:56:24] <NodeX> Vile then the top folder get's updated in the DB
[14:56:44] <Vile> and all of the enclosed documents must be updated as well
[14:57:41] <NodeX> but why?
[14:57:45] <aster1sk> I must add git to that stack as well, I've a openvz CT I build gitlab on top - srsly the most awesome.
[14:58:00] <NodeX> those documetns dont directly contain that string
[15:00:02] <Vile> but if i search using two terms and one of those terms in the document and another in the folder that contains the document, this is considered a match.
[15:00:31] <ppetermann> ron: thats the horrible article i spoke about :p
[15:00:39] <Vile> or contains a folder that contains a document
[15:01:05] <aster1sk> That article was ridiculous. The tool box analogy was just silly.
[15:01:25] <ron> ppetermann: I didn't read 90% of your chatter. this issue bores me now.
[15:02:18] <ppetermann> i see, you learned from my tactics earlier.
[15:02:20] <ppetermann> :p
[15:02:37] <Aim> ppetermann: didnt worked, we are still talking about it :)
[15:03:12] <ppetermann> i'd say that largely depends on my goals? :)
[15:03:25] <Aim> hehe :)
[15:03:39] <NodeX> Vile : it's not a match because it's the file that matches not the folder
[15:03:46] <NodeX> the folder is merely the path to the file
[15:20:38] <telmich> good day
[15:20:46] <ron> I said, good day!
[15:21:19] <krawek> morning guys
[15:22:23] <telmich> how do I add / remove nodes from a replica set that used to have three members, of which two are turned off?
[15:24:57] <Vile> NodeX: that is a requirement for it to be a match
[15:25:55] <telmich> the rs.reconfig() command does not work, because the last node is a secondary - same with rs.add()
[15:46:04] <Derick> MANCHUCK_: both here and in #zendcon? I will be there too
[15:47:23] <ndee> is it possible to retrieve instead of a field, a "nested" field?
[15:47:39] <NodeX> yes
[15:47:44] <Derick> ndee: mongo always returns the whole document (or full fields thereoff)
[15:48:01] <ndee> like, from field Images, only the the part ThumbnailUrl
[15:48:02] <NodeX> db.foo.find({params},{nested_field:1})
[15:48:09] <Derick> if you only want a specific nested field, you could do that with the aggregation framework, but it's probably not worth doing that
[15:48:27] <Derick> NodeX: are you sure? :-)
[15:48:35] <NodeX> I am ;)
[15:48:51] <NodeX> http://www.mongodb.org/display/DOCS/Retrieving+a+Subset+of+Fields
[15:49:00] <ppetermann> what NodeX said.
[15:49:11] <NodeX> select z from things where x="john" -> db.things.find( { x : "john" }, { z : 1 } );
[15:49:23] <Derick> NodeX: thanks, i've learned something :-)
[15:49:36] <NodeX> please dont tell me this is missing from the driver too ? :P
[15:49:43] <Derick> NodeX: not a driver thing
[15:49:45] <ndee> hm, it works in the CLI but not with the PHP driver
[15:49:49] <Derick> hmm
[15:49:54] <NodeX> oh no
[15:49:56] <ndee> lemme try again
[15:49:56] <NodeX> it is hahahaahah
[15:50:09] <NodeX> ndee : in the php driver it's weird to get working
[15:50:17] <NodeX> iirc it exepcts an array
[15:50:23] <ppetermann> it works fine in php
[15:50:25] <NodeX> 1 sec I'll cehck my wrapper
[15:50:25] <ndee> NodeX, can you read my mind? I am using PHP :D
[15:50:48] <Derick> works in the PHP driver for me
[15:50:49] <remonvv> Question, when you hear "doodoo", you think what?
[15:50:59] <ppetermann> its not that weird that it expects an array - what else would you want to give it?
[15:51:00] <Derick> remonvv: dead bird?
[15:51:00] <NodeX> $this->fields=(object)$f; <---- exects (or at least used to) an object
[15:51:08] <Derick> $db->bugs->insert( array( 'foo' => array( 'bar' => 1, 'baz' => 2) ) );
[15:51:08] <Derick> var_dump( $db->bugs->findOne( array(), array( 'foo.bar' => 1 ) ) );
[15:51:14] <remonvv> Oh really? Hm, not that bad then.
[15:51:23] <ndee> ah
[15:51:28] <NodeX> doesn't expect a cast object anymore that's good
[15:51:31] <ppetermann> NodeX: i'm using it for ages now (years) and array was fine
[15:51:55] <NodeX> I could never get it to work and ms Chodrow suggested object and it worked fine
[15:52:03] <ppetermann> weird
[15:52:22] <Derick> NodeX: could have had to do with fields starting with 0 or 1 or so?
[15:52:23] <NodeX> tbh I have not tried it recently
[15:52:51] <NodeX> $cursor = $this->collection->find($this->criteria,$this->fields)
[15:53:08] <NodeX> back to my hardcore hunt
[15:53:36] <NodeX> trackitdown' search sucks
[15:53:45] <ndee> NodeX, do you have an example fields object?
[15:54:21] <ppetermann> 2011-07-03 allow to pull only certain.... <-- thats when i added $fields as array in my framework
[15:54:32] <NodeX> an array afaik ndee
[15:54:38] <esiegel> I'm very new to mongo, but I'd like to back-up a database.
[15:54:40] <NodeX> it would be as Derick has put
[15:54:46] <esiegel> I'm looking at mongodump
[15:54:57] <NodeX> array(your-query), array( 'foo.bar' => 1 ) )
[15:54:59] <esiegel> Which seems great.
[15:55:35] <NodeX> doodoo LOL
[15:55:47] <NodeX> I just laugh when I hear it because I'm imature :P
[15:58:07] <ndee> it works, thanks guys!
[15:59:52] <esiegel> I'd just like to make sure I'm doing this right: $ mongodump --host mongodb1.oursite.com --out ~/oursite/ --db database
[16:00:15] <esiegel> Basically, I'd like to take the database from our server and back it up to a folder on my computer.
[16:03:37] <NodeX> no probs
[16:03:52] <NodeX> looks about right esiegel
[16:04:12] <esiegel> NodeX, thanks. I'm gonna give it a try and home that everything doesn't explode!
[16:16:33] <mongodb> Can anyone recommend a great mongodb hosting platform? I am currently looking at object rocket, mongoHQ, and mongolab
[16:17:01] <mongodb> Crap.. I jacked up my username.. while adding myself to the channel. Hold on guys.
[16:17:17] <ron> omg omg omg!
[16:17:33] <Bartzy> NodeX: Hey, sorry, was away. About NumberLong("34253245325") - the quotes are supposed to be there? Because sometimes they are there and for smaller numbers they are not there.
[16:17:57] <Slaytorson> Okay.. Sorry about that. I was the guy who made my nickname mongodb lol
[16:18:15] <NodeX> it's to do with 64bit int's Bartzy ... if you ask Derick he can explain better than me
[16:18:15] <wereHamster> Bartzy: my guess would be that they are there if the number can't be represented by a javascript number.
[16:18:17] <Slaytorson> ron: the ride is over.. Fun wasn't it?
[16:18:33] <Bartzy> wereHamster: That makes sense, thanks
[16:18:33] <ron> Slaytorson: dude, I did NOT ride on you.
[16:18:36] <Bartzy> Thanks NodeX
[16:18:58] <Slaytorson> ron: totally not what I was saying man.. :/
[16:19:01] <NodeX> from what I remember the driver will cast it back to an int for you on the way out
[16:19:11] <ron> Slaytorson ;)
[16:20:11] <Slaytorson> Now that I got my name straightend out. Does any know of a great mongodb platform? I have been leaning towards ObjectRocket.
[16:20:29] <NodeX> platform?
[16:20:31] <NodeX> paas ?
[16:21:01] <ron> probably.
[16:21:27] <wereHamster> Slaytorson: you found three. Pick one, and use it.
[16:21:50] <wereHamster> if you're leaning towards one, great. Use that one.
[16:22:28] <NodeX> lololol
[16:22:31] <NodeX> best answer ever
[16:22:47] <ron> damn, you sound like a retard when you 'lololol'
[16:22:54] <NodeX> good
[16:22:58] <ron> ;)
[16:22:58] <NodeX> that's my intent
[16:22:59] <Slaytorson> wereHamster: I am wanting to know if anyone has any positive and/or negative experiences with any of them. I am looking for one for mission critical business applications. Obviously I found 3 of them.
[16:23:08] <ron> intent is in android. dude.
[16:23:19] <NodeX> nope it's in both
[16:23:27] <ron> Slaytorson: google.
[16:25:48] <ron> okay, time to read about the aggregation framework.
[16:26:03] <NodeX> it's a good read
[16:26:25] <Slaytorson> Ron: wereHamster: I have googled and done plenty of research. I figured I would ask people specifically in this channel because, well it is the mongodb channel. If you haven't had experience with any of them then you shouldn't be duesh bags about it and you should keep your mouth shut.
[16:27:02] <ron> Slaytorson: I fear that the channel isn't active enough to have people with relevant opinions, but you'd have no way of knowing that unless you're a regular.
[16:29:02] <NodeX> that went well
[16:29:13] <ron> was it something I said?
[16:29:30] <NodeX> some people expect the answer
[16:29:54] <NodeX> and can't take vague answers because they feel like they're "owed" somehting
[16:31:01] <wereHamster> he uses nodejs. Does that say anything about nodejs users?
[16:34:26] <NodeX> that they don't like "vague" answers lol
[16:37:15] <aster1sk> MongoHQ really is amazing.
[16:37:23] <aster1sk> I'm having a lot of fun with it.
[16:37:28] <aster1sk> And Fast too :D
[16:37:33] <NodeX> what is it?
[16:37:45] <aster1sk> mongohq.com
[16:38:26] <aster1sk> I'm evaluating it, really dreading OPS on mongod -- would prefer someone else do that bit.
[16:38:39] <NodeX> they must have alot of ram
[16:39:00] <aster1sk> Yeah, they must have a lot of something... Can't imagine how much traffic they get... I could see that being the bottleneck here.
[16:39:16] <NodeX> Replica Set: Large 10 GB Yes $299 <---- how much? LOL
[16:39:19] <aster1sk> I just changed my connection string and it was functioning immediately without any BS
[16:39:45] <NodeX> that's like a days's work for me
[16:39:51] <NodeX> work -> worth *
[16:40:01] <aster1sk> Is there a tool / algorithm / calculation to guage how big your data set will be?
[16:40:19] <Gargoyle> my tarball backup is 11Gig!
[16:40:23] <aster1sk> All of my stuff is aggregate, single character keys for the most part.
[16:40:36] <NodeX> aster1sk : db.stats()
[16:40:43] <aster1sk> Yeah, I'mm aggregating on MySQL 600 Million rows, so will be significantly smaller.
[16:40:56] <aster1sk> Right, but I'm looking to project how large it will get.
[16:41:07] <NodeX> Single Server: Small 1 GB 30 GB Yes $450 <--- why would anyone pay that
[16:41:12] <aster1sk> Perhaps populate one document, get the size and multiply... dugg
[16:41:34] <NodeX> that's the only real way to determine growth factor
[16:41:39] <aster1sk> Well depends how much time you'll spend fiddling with mongod ops, backups etc.
[16:41:42] <NodeX> O(n) or whatever
[16:42:16] <aster1sk> If CTO spends even two full days mucking with issues / backups etc that's more than the service costs.
[16:42:19] <NodeX> but $450 for 1gb ram
[16:42:34] <aster1sk> Also it's third party liability -- therefor if sh1t breaks you have a finger to point.
[16:42:41] <aster1sk> Yeah that's pretty expensive.
[16:42:56] <algernon> NodeX: SaaS is most often terribly overpriced.
[16:43:07] <aster1sk> ^^
[16:43:12] <NodeX> It's surely cheaper to employ someone to do it in house no?
[16:43:36] <algernon> not always
[16:43:43] <aster1sk> Consider hardware costs, liability, sustainability, uptime... it could get very expensive.
[16:43:57] <algernon> you have to buy the hardware, hire someone to do it, and if it all goes down the drain, that's a lot of money wasted
[16:44:01] <NodeX> one of my clients pays me a weekly retainer to make sure all his stuff is running fine
[16:44:21] <aster1sk> NodeX: sounds like a good gig.
[16:44:38] <NodeX> not bad until somehting goes wrong!
[16:45:08] <NodeX> luckily PHP is such a good language that nothing ever does
[16:45:15] <NodeX> </LOL>
[16:45:21] <aster1sk> trollface.jpg
[16:46:26] <NodeX> I must say thank god for Amazon Arctic
[16:46:46] <NodeX> backups were becoming expensive to put in storage for a while there
[17:08:37] <NodeX> I swear typo's will be the death of me
[17:16:53] <awc737> is it a bad approach to add a new a new global "key" with a default value on thousands of users at once?
[17:19:51] <wereHamster> awc737: if it's a default value, same for every user, then there is no need to store it in the database.
[17:20:05] <wereHamster> just set it when you load the model from the database.
[17:21:04] <awc737> ok, and if they change the value, then add the key/value wereHamster ?
[17:21:44] <wereHamster> yes, then you obviously need to save it in the database.
[17:23:46] <awc737> but wereHamster, I need to be able to pick and choose individual users to receive a field when I create it globally.
[17:24:06] <awc737> won't I need to store something on that user document that says they have that field?
[17:24:07] <wereHamster> eh?
[17:25:08] <awc737> wereHamster, that doesn't make sense?
[17:25:37] <NodeX> awc737 you can $set with a query
[17:25:48] <aster1sk> Heh so with Heroku / MongoHQ I was able to deply my URL shortener in < 7 minutes : http://5kb.us
[17:25:53] <wereHamster> awc737: I don't get your question.
[17:26:03] <NodeX> db.foo.update({query},{$set:{bar:'baz'}},false,true);
[17:26:21] <wereHamster> awc737: whenever you load the document from the database, and the field is not set, you assume the default value. If the field is set, you take whatever it's set to.
[17:26:38] <awc737> wereHamster, you said theres no need to store it in the database. but I do need to store who gets that field on their profile
[17:26:46] <awc737> which could be groups, or even users selected individually
[17:26:46] <wereHamster> awc737: eh?
[17:26:54] <NodeX> awc737 : [18:23:51] <NodeX> db.foo.update({query},{$set:{bar:'baz'}},false,true);
[17:27:38] <zane> So... I did something stupid and modeled a collection in Mongoose with the name "stats". Needless to say, I can't find a way to interact with this collection from the shell... eg, db.stats.renameCollection "is not a function"
[17:27:59] <awc737> NodeX, that solves my needing to specify who inherits which fields?
[17:28:13] <NodeX> yes the "query" part]
[17:28:50] <awc737> and is it expensive to do it on thousands of records?
[17:29:28] <NodeX> not really
[17:29:34] <wereHamster> proportinal to the number of documents.
[17:29:43] <NodeX> though I would not do it all the iem
[17:29:45] <NodeX> time*
[17:31:06] <NodeX> if it's index bound then it could be deemed expensive - as wereHamster says depends on the number of docs
[17:34:19] <joec> I have a secondary server running 30 minutes behind and the web app that accesses it is coded to allow secondary, is there anything I can do server side to force only reads from the primary?
[17:36:33] <wereHamster> joec: that is something you configure on the client.
[17:36:56] <joec> thats what I was afraid of, I'll have to see if the devs can hotfix it
[17:37:03] <joec> thanks wereHamster
[17:38:02] <dblado> hi all -- found a post online about saving a deref() function to the server to get referenced documents but not sure how to run the custom js function with the find() -- anyone point me in the right direction?
[17:38:13] <Bartzy> wereHamster: Never thought about that - not saving default value for most records on the DB, and setting it when I load the model...
[17:38:26] <Bartzy> wereHamster: Doesn't that complicate things if you do it a lot ?
[17:38:27] <wereHamster> joec: http://docs.mongodb.org/manual/reference/glossary/#term-hidden-member
[17:38:46] <wereHamster> joec: http://docs.mongodb.org/manual/administration/replica-sets/#replica-set-hidden-members
[17:39:21] <joec> that sounds like it might do the trick for now until we can get a fix in
[17:39:34] <wereHamster> Bartzy: if you use the raw driver, then maybe. If you use a ODM, then not.
[17:39:52] <wereHamster> I just use: field: { type: String, default: 'teh default value' } and I'm done.
[17:40:11] <Bartzy> in the model, that is ?
[17:40:19] <wereHamster> yes
[17:40:26] <Bartzy> and then when that default value changes for a record - then you save it ?
[17:40:47] <wereHamster> I don't do anything. The ODM does it.
[17:41:15] <wereHamster> I just use: doc.field = 'whatever'; doc.save(); or: doc.field = undefined; doc.save()
[17:41:25] <NodeX> wereHamster : what happens if you want all of your documents to have that value in the DB?
[17:41:34] <NodeX> via your ODM
[17:42:13] <wereHamster> like you would in the shell, or any other driver.
[17:42:34] <Bartzy> wereHamster: And you're doing that to save space in the DB right? Space/index size etc ?
[17:43:16] <NodeX> [18:37:40] <wereHamster> I just use: field: { type: String, default: 'teh default value' } and I'm done.
[17:43:20] <NodeX> but you said you just do that
[17:43:43] <NodeX> does that map it all back and update all the relevant docs?
[17:43:49] <jawr> http://api.mongodb.org/cplusplus/current/classmongo_1_1_b_s_o_n_obj.html#afdb218ee1301ab651692f96bec95d0d9 once i get an ObjectID, how do i extract the creation date?
[17:43:54] <wereHamster> NodeX: then I'm not understanding your question. Do you mean if I want to set the default value on all documents in the database?
[17:44:01] <jawr> Date()?
[17:45:24] <NodeX> no, you said that you just do "field: { type: String, default: 'teh default value' } and I'm done." if you use an ODB
[17:46:11] <wereHamster> NodeX: all it does is: after loading the document from the database, if the field is not set, set it to the default value. So in my application the field is always there, set to a non-null value.
[17:46:34] <Bartzy> or null, if that's the default :D
[17:46:40] <NodeX> yes but that's not really a help if you want it in the database and dont want to wait for the ODM to update everything
[17:47:10] <wereHamster> if you want it in the database then you have to $set it, there is no way around that.
[17:47:29] <Bartzy> wereHamster: Are you using a custom ODM ?
[17:47:59] <wereHamster> Bartzy: mongoose
[17:48:44] <Bartzy> you code web apps with node.js or is it just an analytics/backend service ?
[17:49:26] <wereHamster> isn't an 'analytics/backend service' also a 'web app'?
[17:51:14] <Bartzy> I meant a user-facing web app. i.e. using MVC with node.js
[17:51:40] <wereHamster> well, I have models on the server.
[17:56:44] <jawr> first 4bytes are the timestamp, nice
[17:58:32] <awc737> can I convert any sql field type to a value in nosql?
[17:58:49] <NodeX> field type?
[17:59:04] <awc737> like blob
[17:59:05] <NodeX> your app takes care of the casting normaly
[17:59:26] <tystr_> so I have a question. mongodb fsyncs every minute by default
[17:59:26] <NodeX> if you're looking to store files look at the gridfs part or mongo
[17:59:33] <awc737> ok
[17:59:34] <tystr_> this is done synchroneously, right?
[18:00:08] <awc737> NodeX, I am looking at having MySQL fields sent to mongo from time to time
[18:00:12] <awc737> i'm wondering if I should just use text field
[18:00:18] <awc737> and what length
[18:00:29] <NodeX> you dont define anything in Mongo
[18:00:37] <NodeX> your app takes care of all of that
[18:01:03] <awc737> whats the max length of a value?
[18:01:16] <NodeX> if you want to get your head round Mongo then forget everything you know about SQL
[18:01:24] <NodeX> the max document length is currently 16mb
[18:01:32] <NodeX> afaik there is no max field length
[18:01:38] <NodeX> field/value
[18:01:54] <NodeX> (apart from the max doc length)
[18:02:48] <awc737> NodeX, the thing is I need to use them in conjunction
[18:03:26] <NodeX> I dont see the problem sorry
[18:03:41] <awc737> well you said forget everything i know lol
[18:03:45] <awc737> then half my app will work :)
[18:04:14] <awc737> so in mysql I will have a users table, and a users_attributes table. users_attributes will just have id / key / value / ordering
[18:04:54] <awc737> if the admin adds new user_attribute, such as 'website', and only selects one user group, it will then add that key / value pair to each user document in that group
[18:04:57] <NodeX> I was being latteral
[18:05:31] <jawr> would be nice if OID kept another 4bytes expressing when it was last updated
[18:05:36] <NodeX> I still dont see the problem
[18:05:57] <awc737> NodeX, no problem I supposed, does that sound like an OK plan though?
[18:05:57] <NodeX> jawr it would but the cardinality would then be less
[18:06:20] <wereHamster> awc737: isn't your question basically how to map your mysql model to a mongodb model?
[18:06:30] <awc737> yeah I suppose
[18:06:41] <NodeX> awc737 : what are your reasons for using mongo
[18:06:51] <wereHamster> awc737: http://www.mongodb.org/display/DOCS/Schema+Design
[18:07:24] <NodeX> because modeling an app to work in both will be a headache because Mongo is so flexible
[18:07:27] <awc737> wereHamster, my reason is that I don't know what key / values a product might have. i might define one globally for all products, and I might add one to one product
[18:07:41] <awc737> the global definition is the reason I still want some SQL
[18:07:43] <NodeX> you will drop that flexibility because*sql isn't so flexible
[18:08:25] <NodeX> you might be better asking if you cna do your app without SQL all together
[18:08:57] <awc737> i'm not sure, alot of people have told me don't
[18:09:23] <wereHamster> so why do you want to use mongodb?
[18:09:54] <tystr_> sp we
[18:09:56] <tystr_> oops
[18:09:58] <NodeX> some people do use mongo for certian things, it sounds like you're trying to have your cake and eat it
[18:10:16] <tystr_> so we're getting random load spikes on our mongodb primary, and we suspect it's due to disk io latency during the fsync op
[18:10:26] <NodeX> the people that tend to use mongo and SQL in the same world dont tend to mix tables and try to model the same thing in both sysems
[18:10:41] <NodeX> systems*
[18:10:50] <awc737> well I want the admin to be able to define attributes, for example, globally
[18:11:02] <wereHamster> you can do that in sql just fine.
[18:11:07] <awc737> and then specificy what groups, or individual products receive that attribute
[18:11:08] <NodeX> or in mongo
[18:11:19] <NodeX> you can do both in both so far
[18:11:55] <awc737> trying to decide which is best. My company uses SOLR becuase they think they need "fast indexing for search queries", and I thought I should probably look for something comparable
[18:12:03] <awc737> I was led to believe it was with nosql
[18:12:07] <NodeX> I use mongo + solr
[18:12:20] <NodeX> they play very nicely together
[18:12:25] <wereHamster> awc737: mongo is not a search engine.
[18:12:56] <awc737> right, but I will probably use elasticsearch, in which case having my products with an attributes key/value, would probably play nice in sending that data to ES
[18:13:12] <NodeX> mongo and ES also play nicely together
[18:13:26] <NodeX> ES is a little green and buggy for my taste but I know plenty of people who do use it
[18:13:43] <awc737> so I was thinking let me admin define fields in SQL, select which groups or users receives that field, and that stores the attribute / default value into the product document
[18:13:52] <tystr_> :(
[18:13:57] <awc737> i mean let my admin define attributes* in SQL
[18:13:57] <wereHamster> why not store it in sql?
[18:14:08] <awc737> store the document in sql?
[18:14:16] <wereHamster> to me nothing so far would suggest that you need mongo
[18:14:38] <NodeX> ^ not to say it can't be done in mongo lol
[18:15:05] <awc737> the concept here, (also relevant for Mongo), is what leads me to believe I *should* use NoSQL: http://neilmiddleton.com/the-wonders-of-hstore/
[18:15:32] <awc737> if you just look at the INSERT INTO products code snip
[18:15:34] <wereHamster> well, if he already has an existing sql database, and wants to keep using it, then adding yet another database is unnecessary overhead
[18:15:56] <awc737> no i don't really have anything yet, still planning
[18:16:13] <NodeX> if you have the need for flexible schema's that your app decides on then I suggest mongo
[18:16:27] <NodeX> among the other main reasons (speed, scalability)
[18:16:38] <NodeX> if you dont then I would save the headache of learngin soemhting new
[18:16:44] <NodeX> learning*
[18:18:04] <awc737> well I was thinking both would be nice because my admin could define a global attribute, and I could use SQL relationship to determing which products had the attribute
[18:18:24] <NodeX> you can do it all in one or the other
[18:18:24] <awc737> and IF the attribute value is changed for a specific product, then that changes the product's document value
[18:18:36] <NodeX> there is NO river from SQL to mongo
[18:18:48] <NodeX> you can't plug somehting into the DB to auto update mongo
[18:18:56] <awc737> it wouldn't be a plug
[18:19:01] <NodeX> every update has to be done in your app
[18:19:03] <awc737> my app would do it
[18:19:20] <NodeX> as wereHamster says, there is still no need for 2 databases
[18:19:26] <NodeX> either will work fine
[18:19:56] <awc737> what about postgresql hstore
[18:20:46] <NodeX> never heard of it
[18:20:52] <NodeX> until that post *
[18:37:41] <Goopyo> Hey what would the use cases for asynchronous mongodb? Is that just for instances where you dont really care about the response?
[18:37:48] <Goopyo> Reading up on Motor now
[18:39:31] <konr_trab> I've got three tables, foo, bar and baz. I'd like to concatenate them into another table, FBB: how can I do so?
[18:40:23] <Goopyo> They're called collections, taht should help you search it
[18:40:30] <Goopyo> http://stackoverflow.com/questions/5681851/mongodb-combine-data-from-multiple-collections-in-to-one-how
[18:40:37] <devdazed> konr_trab: you could do a mongoexport on each and import them each into FBB
[18:40:56] <Goopyo> http://tebros.com/2011/07/using-mongodb-mapreduce-to-join-2-collections/
[18:49:55] <konr_trab> I thank you, dear friends, for your help and wonderful DB, and so I say goodbye and wish you a merry day!
[19:01:01] <tystr_> is it possible to have secondaries in a replica set only replicate certain collections?
[19:10:56] <tystr_> grr max 12 members in a replica set
[19:40:25] <tystr_> Question: Is there a limit to how many connections can tail a capped collection?
[19:45:06] <jrdn> I want to know the same thing tystr_ !!
[19:45:08] <jrdn> Weird!
[19:45:12] <tystr_> no way!
[19:45:14] <jrdn> Anyone??!
[19:45:18] <tystr_> ^^
[20:13:21] <dominikd> i have a collection i'd like to expose as an API, is there an easy way or should i whip something up in python+flask?
[20:57:40] <awc737> should a mongo record look like: [["key","value"],["key","value"]]
[20:59:13] <awc737> whats the difference between a json object and json array?
[22:11:33] <jrdn> this is the channel of questions… not the channel of answers
[22:13:16] <_m> jrdn: Did you have a question?
[22:26:28] <jrdn> nope :P
[22:27:37] <_m> For those of you who don't get the email blasts, there are upcoming free online MongoDB courses
[22:27:38] <_m> http://education.10gen.com/
[22:29:50] <jawr> awesome, thanks for the link _m
[22:31:04] <opus_> I'm pulling results from my collection, which contains rows of rows. I want to modify one of those rows inside the result, do I really have to do forEach and then find it then modify it?
[22:32:25] <_m> opus_: In pure mongo, I would use the positional operator with and update query
[22:32:42] <opus_> like, this is sort of what I want to do: db.company.find({name:"bob"}).find({store:"washington"})
[22:32:47] <opus_> i'm trying to us Mongous
[22:33:33] <opus_> _M, is there a node.js package that handles 'positional operators'?
[22:34:07] <_m> You're trying to modify the row in place, or do you need to manipulate it in your stack?
[22:36:01] <opus_> a row within a row
[22:37:20] <_m> So you want to find the company with a specified 'name', and a 'store' nested document within said company's document, correct?
[22:37:36] <opus_> i'd be nice if I could just db("collection.company").find("bob").("stores").find("washington").set("status=closed") (obviously psuedo code)
[22:37:42] <opus_> yes
[22:38:09] <opus_> Nested document sounds like what I am doing
[22:40:15] <_m> http://stackoverflow.com/questions/8292707/updating-nested-document-in-mongodb
[22:40:39] <_m> While the question isn't exactly your issue, the solution should fit nicely.
[22:42:10] <_m> Also see: http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24elemMatch
[22:42:10] <opus_> ok, any other keywords I could use to google an answer for? i'm mostly using node.js
[22:42:55] <_m> http://www.mongodb.org/display/DOCS/Updating#Updating-The%24positionaloperator
[22:46:33] <jtomasrl> how should i find the table with number = 1? [{"name": "foo", "tables": [{"number": 1}, {"number": 2}]}]
[22:47:57] <_m> jtomasrl: db.foo.find({ "tables.number" : 1 })
[22:49:28] <_m> If that field is an array within a document, you'll want to prepend the container field's name to that query. EG: db.foo.find({ "bar.tables.number" : 1 })
[22:53:20] <jtomasrl> _m: cant get it to work
[22:53:31] <jtomasrl> https://gist.github.com/3915225
[22:58:29] <_m> You don't need the $and in there.
[22:58:46] <_m> collection.findOne({ "name": storeName, "tables.number": tableNumber } )
[22:59:22] <jtomasrl> doesnt work :S
[22:59:35] <_m> Have you tried from the mongo console?
[23:00:36] <jtomasrl> i get the whole document
[23:00:48] <_m> Well, yeah.
[23:01:10] <_m> That's how it *should* work
[23:01:28] <jtomasrl> so i need to "select" the table number = 1 from there
[23:03:48] <_m> You can do the filtering client-side, or move the tables to a separate collection. By http://www.mongodb.org/display/DOCS/Retrieving+a+Subset+of+Fields - only the tables field - this should be reasonably fast.
[23:06:13] <jtomasrl> hmm
[23:13:58] <jtomasrl> _m: is it possible to select only that table number?
[23:16:50] <opus_> I think my question is similar
[23:17:31] <opus_> I just want to return the nested row that matches, which has its own unique id
[23:23:00] <opus_> But it seems to return all of the nest, and just the column that I wanted to match on
[23:25:45] <opus_> any pointers or ideas?