PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Monday the 4th of June, 2012

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[16:24:59] <zirpubolci> why do you need an autoincrement field?
[21:27:19] <jstout24> what's the best way to reorder a referenced collection
[21:27:50] <jstout24> ie) path has a many references to `pages`… there's a field in `pages` called `position` and whenever the position changes, i want to resort all the references so it always goes in order
[21:28:34] <jstout24> do i { $unset: { pages: true } } then $pushAll?
[21:39:35] <dgottlieb> jstout24: I think a { $set: {pages: <pages_array>} } accomplishes the same as $unset and $pushAll, but in one step
[21:40:10] <BadDesign> Is there a way to convert JSON object to DBOject in MongoDB?
[21:40:13] <jstout24> oh true… yeah my odm was automatically doing the unset, but i'll see if i can force the update differently
[21:40:21] <BadDesign> (using the Java driver)
[21:41:13] <rubynoob2> when I store JSON in mongodb.. why is it escaping double quotes and slashes with backslash?
[21:49:40] <skot> BadDesign: you can use JSON.parse(…) to produce a DBObject
[21:50:58] <dstorrs> rubynoob2: most likely you're storing it in a way that says "escape this string"
[22:08:28] <rubynoob2> "ws_response_json" : "{\"ResultSet\":{\"totalResultsAvailable\":\"0\",\"totalResultsReturned\":\"0\",\"firstResultPosition\":\"21\",\"ResultSetMapUrl\":\"\"}}\n"
[22:08:56] <rubynoob2> why is mongodb storing my json like that?
[22:14:48] <skot> It isn't, that looks like a printing issue.
[22:32:23] <rubynoob2> dstorrs, skot, thank you.. I'll have to google more on this..
[22:37:54] <dstorrs> how do you run a regular JS function across a value in your collection?
[22:44:22] <dstorrs> I found this, but that doesn't fit the need: http://www.mongodb.org/display/DOCS/Scripting+the+shell
[22:47:44] <skot> using $where
[22:48:23] <skot> you can do this: db.coll.find({$where:function() { if (this.a == 2) {return true;}}})
[22:50:27] <dstorrs> and then if I want to actually run a JS function across the '.a' value (e.g. 'length()'), how would I do that? ...return trye;}}}).forEach( print ) ?
[22:50:42] <dstorrs> (assuming I'm in the shell?)
[23:43:42] <edoceo> anyone got handy scripts to migrate from Couch to Mongo?
[23:45:22] <dstorrs> edoceo: sounds like something that would be very schema-specific
[23:50:16] <acidjazz> oh sang
[23:50:40] <acidjazz> i got a segfault error in php/apache trying to instanciate MongoGridFS
[23:51:18] <dstorrs> "sang" ? that's a new one.
[23:52:32] <acidjazz> http://stackoverflow.com/questions/10111338/php-mongogridfs-apache-errors is my issue
[23:52:42] <acidjazz> i sang an oh dang
[23:52:54] <dstorrs> ah
[23:53:11] <dstorrs> heh. funny thing -- I was just about to paste you the link to that SO error
[23:53:18] <acidjazz> so i gotta upgrade/downgrade eh
[23:53:25] <acidjazz> man i was all using the apt packages too
[23:53:33] <acidjazz> ill do an apt upgrade see if that hopefully upgrades mongo
[23:54:04] <acidjazz> nope segfault
[23:54:29] <acidjazz> looks like im 1.8
[23:57:51] <acidjazz> i have a feeling upgrading by replacing the binaries will break the php module