PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Sunday the 6th of November, 2016

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[05:13:41] <klekowskii> Hello
[05:15:36] <klekowskii> The mongodb documentation says that bson files are maximum 16MB , but I have one 21MB File and it is working fine
[05:15:47] <klekowskii> how can I know the real limit ?
[05:32:16] <klekowskii> got it!, thanks anyway :)
[13:36:50] <nishu-tryinghard> how can i make sure of getting the total count of the documents and also the filter count i.e after $match in a single aggregate query in mongo. I know of a way to do this by using 3 queries but i think there must be a better way to do it. 1) get the count of the collection 2) after match get the count by group by 3) get the actual results. Here is the query which iam using at present https://gist.github.com/nishugit/4605a8f61243abe95f15eadbb0
[13:36:50] <nishu-tryinghard> 4d3301
[14:23:00] <YokoBR> hi folks
[14:23:17] <YokoBR> please, I can't filter some results on mongodb's php driver
[14:23:31] <YokoBR> I've been searching for a solution for days
[14:24:44] <YokoBR> in mysql it would be something like "where title like %$filter% or description like %filter% or short_description like %filter%"
[14:35:07] <YokoBR> is there a better way to use mongo than MongoDB\Driver\Manager::executeQuery ?
[14:57:00] <YokoBR> please folks
[14:57:19] <YokoBR> $search = $this->mongodb->reader( 'efforts', false, ['type'=>'normal']); returns right, $search = $this->mongodb->reader( 'efforts', false, ['type'=>'/^normal/i']); returns none
[14:57:22] <YokoBR> why?
[15:23:59] <YokoBR> :'(
[15:30:35] <deathanchor> YokoBR: what language is that?
[15:31:04] <deathanchor> php? python?
[15:31:53] <deathanchor> for regexes in mongodb you usually just do { 'type' : /normal/i }, but depending which programming language you might have to do soemthing different
[15:34:02] <Derick> deathanchor: on the shell, yes. For drivers, you need to wrap it in an object.
[15:34:47] <deathanchor> yeah depends on what is being used. It's different for php and python, I don't recognize what his code is. Perhaps Perl?
[15:35:20] <Derick> it's PHP
[15:35:20] <deathanchor> I think with perl you also don't need to wrap it in quotes
[15:36:35] <YokoBR> deathanchor: php, but nevermind, just figured it out with [ '$or' => [ ['title' => ['$regex'=>$effort, '$options'=> 'i']],
[15:37:17] <Derick> that's not right either for PHP
[15:37:48] <Derick> you need to wrap it in an object: http://php.net/manual/en/class.mongodb-bson-regex.php
[15:38:14] <deathanchor> you need to use MongoRegex()
[15:38:40] <Derick> no, that's for the old deprecated driver
[15:38:52] <Derick> the new one uses \MongoDB\BSON\Regex
[15:42:38] <deathanchor> but I like being old crusty and deprecated :D
[15:52:59] <YokoBR> but here's another one
[15:53:36] <YokoBR> the $result->_id comes as empty, because it's ObjectId("581adf2213e952000b2eafc4"). How do I parse that?
[15:54:34] <Derick> how is it "empty" ?
[15:55:30] <YokoBR> nevermind
[15:55:36] <YokoBR> (string)$result->_id
[15:55:38] <YokoBR> solved it
[15:56:26] <Derick> yes, \MongoDB\BSON\ObjectID implements __toString(): http://php.net/manual/en/class.mongodb-bson-objectid.php
[17:25:36] <YokoBR> folks
[17:25:44] <YokoBR> how do I use regex into an array
[17:26:19] <YokoBR> $search = $this->mongodb->reader( 'efforts', false, ['tags' => ['$regex'=>$tag, '$options'=> 'i']]); this works for a simple row, but not an array.
[19:38:35] <qswz> is it just me, or we can't connect to a local mongodb when offline?
[19:39:09] <qswz> I had no connection today, and couldn't connect with the local mongod
[21:58:30] <TehGrub> hi
[21:58:35] <TehGrub> i have an issue
[21:58:46] <TehGrub> its a strange issue i will try to explain
[22:00:38] <TehGrub> so i have these objects in a collection and inside these objects is an array. and the array is a json array, and one of them variables inside this array is a number. and i want to do a less than, sort and limit on this array
[22:00:42] <TehGrub> using that number
[22:01:36] <TehGrub> hold on i will try to recreate my issue
[22:07:48] <TehGrub> http://pastebin.com/HYt1PP6D
[22:07:58] <TehGrub> i want to perform a lessThan search inside the number. and say i have a 1000 in that "myarray" array. i would like to be able to get lessThan a certain number and then do a sort or a limit without calling this full object into view. How can i do this?
[22:21:43] <bros> How can I call a stored function during an aggregation?
[23:10:02] <bros> I got a really good one. https://gist.github.com/skulabs/8287174d9b0a5631172a74bf846d88e0 How can I do this better with the database?
[23:27:25] <qswz> ObjectId('5745f3cdaa93a8de31c4a0a0')==ObjectId('5745f3cdaa93a8de31c4a0a0') I guess this is false
[23:27:45] <qswz> oh .equals
[23:28:56] <qswz> how are you calling async methods synchronously
[23:29:15] <qswz> .findOne should return a promise