[12:49:22] <finalspy> Sorry I got disconnected, excuse me if th message appears twice, here's my initial question : Hi again, I created a payment intent, from my server, I used the card Element on the client side to fullfill the payment card data, I can see the payment intent on the stripe side : pi_1EehnZCMNUdfA2XP8CIHv77H but it is said "incomplete" . What am i missing ?
[12:50:01] <finalspy> Oh sorry not the right chan :(
[12:50:16] <GothAlice> Yup, that sounds very specific and not MongoDB. ;P
[19:08:21] <bluezone> I'm coding in nodejs, using the mongodb driver for nodejs
[19:09:03] <bluezone> Is there any API in the driver to copy a database, rename it, then save it ?
[19:16:44] <GothAlice> bluezone: https://docs.mongodb.com/manual/release-notes/4.0-compatibility/#deprecate-copydb-clone-cmds — what you describe would seem to have been frequently mis-used, an “anti-feature”, thus deprecation.
[19:17:57] <GothAlice> (For example, is the database otherwise accessible while the data is being duplicated? I might not assume it would be; foreground index builds, for example, block other connections.)
[19:18:27] <bluezone> Yeah i saw it was deprecated also
[19:18:50] <bluezone> We have a database that doesn't change, it's just like a template if you will
[19:19:03] <GothAlice> Then mongodump it, and mongorestore from that saved “template”.
[19:19:43] <bluezone> Would it make more sense to just create a new database and somehow just copy over the collections one at a time? There is almost no data in it
[19:19:45] <GothAlice> Straight mongorestore of BSON files on-disk would be extremely fast, and if dumped into a new database (not otherwise utilized at the time), then there would be no issues with index builds blocking.
[19:19:58] <GothAlice> Nope, I would not “clone” live databases in this way.
[19:20:18] <GothAlice> What you actually have is called a “fixture”. Essentially a template to populate an empty DB with, to get started using some project.
[19:22:22] <GothAlice> It relies on an assumed state of that template database.
[19:22:32] <GothAlice> A fixture file, on the other hand, is far more reliable.
[19:23:08] <GothAlice> https://gist.github.com/amcgregor/2ee995e76fb372782968c1b6fd090b5a?ts=4 is an example of one of my own fixtures serialized as XML. CapitalizedNames are “classes” being constructed/initialized, lower_names are attributes.
[19:23:36] <GothAlice> With all Asset types (Asset, Page, Folder, File, …) stored within one collection, “assets”.
[19:28:04] <GothAlice> (The actual “fixture” is a bit more substantial, with JobOffer and JobSearch and SearchResults sprinkled where needed, of course. Then I duplicate the fixture and customize it to specific client needs before “nuking the site from orbit” to pull in the fixture.) Literally, the API call is called “nuke”. ;^P
[19:29:02] <GothAlice> Ah, here’s a more complete example: https://gist.github.com/amcgregor/c6ae92325a941ba70568?ts=4
[19:30:19] <GothAlice> Ooh, that one even features a custom <Form>. Fancy! XP
[19:31:45] <bluezone> Alors, vous utilizer quel sorte de program qui parse ca et fait la procedure de creation de la nouvelle base de donner? :)
[19:33:57] <GothAlice> It’s a very simple LXML process in Python, though. Mostly just an “unknown tag” handler.
[19:34:22] <GothAlice> (That XML structure is actually _highly_ “regular”, in the “regular expression” sense. Turtles all the way down. ;)
[19:34:41] <bluezone> I guess not sure what to do now, my boss says mongodump and restore would be overkill for such a small fixture
[19:35:15] <GothAlice> I’d gently remind him that “mongorestore” is the official way to ingest data into MongoDB. Point him at that deprecation notice which explicitly says to use mongorestore as a replacement.
[19:35:17] <bluezone> I don't understand the benefit of that over iterating the collections
[19:36:14] <GothAlice> Again: questions over impact to other connections. If you “copy” a collection, are the indexes literally copied, or rebuilt? If they’re rebuilt, are they rebuilt in the background? …
[19:36:34] <GothAlice> If they’re not rebuilt in the background, your “simple collection.copy()” just brought down your site.
[19:37:07] <GothAlice> (At least, until the copy and index builds finish, potentially. ;)
[19:38:02] <GothAlice> Thus it is far preferable to have a single point of data ingress (ingestion, that is, import) vs. allowing many different ways.
[19:40:40] <bluezone> ok thanks so much GothAlice very helpful :)
[19:40:54] <bluezone> I am also from montreal, sorry I went to your profile haha
[19:45:25] <GothAlice> It’s no worries. I’m proud to advertise my location, given if I wasn’t living here two years ago, I’d be dead! <3 McGill Neuro and Dr. Shaalala, one of the top five neurosurgeons in Canada!
[19:47:01] <GothAlice> Pro tip: if you have a sitting job, get up and moving (actually moving, not just standing in place) at least once an hour to prevent DVT (deep-vein thrombosis; blood clots in your legs). Initially presented with that after a clot moved from leg to lung (ouch!), they hit me with thinners to break it up, and a vessel in my brain decided that was a great time to pop.
[19:48:34] <GothAlice> http://s.webcore.io/2b0H3g453w2q/cerebral-artereoveinous-malformation--AVM.png — the capillaries between vein and artery didn’t differentiate. Turned that network into a high-pressure system; luckily, that’s was on the surface, not IN my brain!
[19:50:04] <GothAlice> If it was in, there’d have been little they could have done. Always a nice thought! ;^P (For a happy one: after they woke me from the medical coma, that was the first time in my life I had ever heard silence. That network was previously like a dishwasher in rinse mode… constantly wooshing.)
[19:55:06] <bluezone> It's rare to hear about a good success story in montreal healthcare, I guess only hear the bad ones
[19:56:06] <GothAlice> Indeed; there’s also a strong psychological drive to remembering negative experiences more strongly than positive ones, too. (Nobody cares if the blue berries didn’t kill you, everybody cares if there’s a lion hiding in the bush. ;)
[20:01:21] <bluezone> related to disk space if it's a large collection
[20:01:37] <bluezone> (if template db becomes too large for some reason i mean)
[20:04:07] <bluezone> he said can have the indecies be rebuilt in background (that they are doing it already). Anyway I don't really know what an index is so
[20:04:33] <bluezone> I only know primary key/foreign key/secondary key
[20:09:20] <GothAlice> bluezone: Does your boss plan on hosting the Library of Congress?
[20:11:28] <GothAlice> The example I use when people are concerned about the mythical “document size limit” in MongoDB is: unless you’re writing more than 200 novel chapters (averaging 5,000 words per chapter), you’re not going to hit that limit.
[20:11:48] <GothAlice> That’s the limit on one of my forum threads, where every reply to the thread is embedded within that one thread document.
[20:12:05] <GothAlice> (A group of 12,000 gamers failed to reach that limit. ;)
[20:12:50] <GothAlice> Or, to try to use the most compact possible example, a 16MB document could store, as the largest possible Array that can be stored: 2 million NULLs.
[20:18:14] <bluezone> He says he already encounters many issues with disc space running out, there's like millions of data points and records, I dunno. He said we would discuss more tomorrow
[20:18:44] <bluezone> I agree that it's better to use this mongodump instead of writing custom code to copy tbh
[20:19:31] <bluezone> if it's just a template database, I don't know why he is worrying about disc space