PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Monday the 4th of November, 2019

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[10:19:02] <robertparkerx> is there anything wrong with this: $this->collection[$collection]->deleteOne(array("timeOfDelivery" => array('$lt' => date("Ymd")),array('socketTimeoutMS'=>-1))
[10:19:44] <robertparkerx> $this->collection[$collection]->deleteOne(array("timeOfDelivery" => array('$lt' => date("Ymd"))),array('socketTimeoutMS'=>-1)) sorry
[12:48:22] <GothAlice> Apologies for the snark, but right up-front it smacks of PHP. Problem #1: PHP. ;^P Problem #2: consistency of quote use. (I stick to single quotes for machine strings, double quotes for human strings.) Q: Does date() return some form of actual Date object that the MongoDB driver knows how to handle? Lastly, #3: no sort order is defined, so the single record removed may appear randomly selected—but isn’t.
[12:48:25] <GothAlice> robertparkerx: ^
[13:05:34] <robertparkerx> Yes I think it does return date that mongodb can handle but the rest I will fix
[13:05:47] <robertparkerx> I think I was suppposed to use deleteMany instead of deleteOne :s
[13:11:26] <robertparkerx> Thank you GothAlice
[13:16:36] <GothAlice> Does PHP not support object literals? O_o Always found array() notation to be… ugly and verbose, esp. when you start getting three or four on a single invocation. ^_^
[13:17:58] <synthmeat> all of php is just one messy string template
[13:34:42] <GothAlice> Fun factoid, after PHP introduced SimpleXML, I wrote JSX before JSX. ¬_¬ https://github.com/amcgregor/margin-cms/blob/master/documents/details.xml?ts=4 with <Breadcrumb> implemented https://github.com/amcgregor/margin-cms/blob/master/templates/default/Breadcrumb.php :333
[13:35:29] <GothAlice> 2014 awesomeness written… 2005. XDDD
[13:35:48] <synthmeat> it's a shame web lost battle for xhtml. that could've been so awesome.
[13:36:33] <GothAlice> “Standards Mode”, “Compatibility Mode”, “Legacy IE Mode”, “<insert brain damage here>” — could have been. Was not.
[13:38:05] <GothAlice> HTML5, as-is, is superior to XML in a number of ways for the purpose of document mark-up. Rules for canonicalization mean 90% of the HTML people write people don’t need to write. At all. <!DOCTYPE html><title>Hi</title><p>This is a valid—and complete—HTML document.
[13:39:10] <GothAlice> (HTML, head, and body tags are shockingly optional.)
[13:42:26] <robertparkerx> I liked xhtml
[13:42:49] <synthmeat> i'd love a world where google gives just me a dtd for whatever they want to be present in the page, and i just validate against that.
[13:43:54] <synthmeat> and tw. and fb. ... and then they need to agree on common dtd elements and everything's fine and dandy
[13:45:37] <GothAlice> “agree”
[13:45:56] <GothAlice> https://www.xkcd.com/927/
[21:52:44] <codebam> should my userlist be in it's own database?
[21:52:50] <codebam> how should I get a list of users?
[21:52:53] <codebam> or...
[21:52:58] <codebam> I guess I should query the database
[21:53:34] <GothAlice> codebam: http://s.webcore.io/fVpr/zzinger-best-practices-morpheus.jpg
[21:53:46] <GothAlice> Consider: what benefit does segregating that data offer?
[21:54:17] <codebam> not for security, for... usage?
[21:54:18] <codebam> idk
[21:54:22] <codebam> for ease of use
[21:54:29] <codebam> so I guess I wont
[21:54:50] <GothAlice> But separating them out means more steps to make use, e.g. switching the active DB (or having multiple DB handles hanging around). Thus in no way easier.
[21:55:08] <GothAlice> Best case: it's just different.
[21:55:18] <codebam> if I made a schema for reqular sql. what would I need to do to adapt that to mongo/nosql?
[21:55:27] <codebam> s/if /g
[21:55:33] <GothAlice> https://docs.mongodb.com/v3.2/core/document-validation/
[21:55:44] <codebam> oh, okay cool
[21:56:06] <GothAlice> Noting that validation documents are infinitely more powerful than SQL schema. Given you can use $and / $or combining operators to make parts of your validation optional or conditional.
[21:56:53] <codebam> this is awful. I'm trying to figure out mongo, vue, and trying to write a login page all in a couple days
[21:56:55] <codebam> kill me
[21:57:02] <GothAlice> (A validation document / "schema" being, in MongoDB's case, a filter document that must match for the record to be considered valid.)
[21:57:27] <codebam> right I see okay
[21:57:40] <GothAlice> Surprisingly powerful simple idea, that. :)
[21:57:43] <codebam> so it would just be the same, each table owuld be a schema in mongo?
[21:58:00] <GothAlice> Validation document covering a collection, aye. The equivalent of a schema covering a table.
[21:58:12] <codebam> okay awesome
[21:58:35] <codebam> is there any way I could just "convert" my postgres schema into mongo?
[21:58:42] <GothAlice> Note that for basic SQL schema needs, that is, type declaration, there is the $type filter operator.
[21:58:43] <codebam> I have it all made as valid postgres commands
[21:59:03] <GothAlice> (https://docs.mongodb.com/v3.2/reference/operator/query/type/index.html)
[21:59:14] <GothAlice> Alas, not that I'm aware of.
[21:59:27] <codebam> okay, that's alright thanks
[22:01:09] <codebam> OH right I don't need to create DBs in mongo before inserting