From de8ab6ec6d049a60d6bc2a4151eb7298f77e069d Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Sat, 15 Jun 2024 11:15:03 +0100 Subject: [PATCH] Autosave: 2024-06-15 11:15:03 --- zk/5__Integrating_the_Mongo_database.md | 4 ++-- ...d => Application_state_management_with_React_hooks.md} | 1 - zk/{Built_in_hooks.md => Built_in_React_hooks.md} | 1 - ...data_flow.md => Child_to_parent_data_flow_in_React.md} | 4 +++- ...es_to_hooks.md => Comparing_React_classes_to_hooks.md} | 2 -- zk/Components_props_classes.md | 1 - ..._props_hooks.md => Components_props_hooks_in_React.md} | 1 - zk/Creating_a_Mongo_schema_and_model.md | 2 +- ...tom_hook_examples.md => Custom_React_hook_examples.md} | 1 - zk/Dates_in_Python.md | 4 +++- zk/{Deleting_documents.md => Deleting_Mongo_documents.md} | 6 +++++- zk/{Importing_data.md => Importing_MongoDB_data.md} | 5 ++++- ...tionships.md => Modelling_relationships_in_MongoDB.md} | 6 +++++- zk/{Introduction.md => MongoDB_Introduction.md} | 4 +++- ...ing_a_collection.md => Querying_a_Mongo_collection.md} | 6 +++++- zk/Structuring_Express_applications.md | 1 - zk/Time_and_computers.md | 4 +++- zk/Type_hinting.md | 4 +++- zk/{Update_document.md => Update_a_Mongo_document.md} | 8 ++++++-- zk/Validating_Mongoose_schemas.md | 6 +++++- zk/useContext.md | 2 +- 21 files changed, 49 insertions(+), 24 deletions(-) rename zk/{Application_state_management.md => Application_state_management_with_React_hooks.md} (99%) rename zk/{Built_in_hooks.md => Built_in_React_hooks.md} (99%) rename zk/{Child_to_parent_data_flow.md => Child_to_parent_data_flow_in_React.md} (97%) rename zk/{Comparing_classes_to_hooks.md => Comparing_React_classes_to_hooks.md} (99%) rename zk/{Components_props_hooks.md => Components_props_hooks_in_React.md} (99%) rename zk/{Custom_hook_examples.md => Custom_React_hook_examples.md} (99%) rename zk/{Deleting_documents.md => Deleting_Mongo_documents.md} (88%) rename zk/{Importing_data.md => Importing_MongoDB_data.md} (90%) rename zk/{Modelling_relationships.md => Modelling_relationships_in_MongoDB.md} (98%) rename zk/{Introduction.md => MongoDB_Introduction.md} (97%) rename zk/{Querying_a_collection.md => Querying_a_Mongo_collection.md} (98%) rename zk/{Update_document.md => Update_a_Mongo_document.md} (94%) diff --git a/zk/5__Integrating_the_Mongo_database.md b/zk/5__Integrating_the_Mongo_database.md index 11aabae..719362b 100644 --- a/zk/5__Integrating_the_Mongo_database.md +++ b/zk/5__Integrating_the_Mongo_database.md @@ -124,7 +124,7 @@ const Course = mongoose.model( Now we need to rewrite our RESTful request handlers so that the data is sourced from and added to the database. We will mainly be using the Mongo syntax defined -at [Querying a collection](Querying_a_collection.md) and +at [Querying a collection](Querying_a_Mongo_collection.md) and [Adding documents to a collection](Adding_documents_to_a_Mongo_collection.md). We will also keep API validation within the `/model/` file. @@ -176,7 +176,7 @@ router.post("/", async (req, res) => { ### PUT When updating a value in the database we are going to use the -[query-first](Update_document.md#query-first-document-update) +[query-first](Update_a_Mongo_document.md#query-first-document-update) approach to updating a Mongo document. ```jsconst courseSchema = new mongoose.Schema({ diff --git a/zk/Application_state_management.md b/zk/Application_state_management_with_React_hooks.md similarity index 99% rename from zk/Application_state_management.md rename to zk/Application_state_management_with_React_hooks.md index 7d41059..30283b7 100644 --- a/zk/Application_state_management.md +++ b/zk/Application_state_management_with_React_hooks.md @@ -2,7 +2,6 @@ tags: - javascript - react - - react-hooks --- # Application state management diff --git a/zk/Built_in_hooks.md b/zk/Built_in_React_hooks.md similarity index 99% rename from zk/Built_in_hooks.md rename to zk/Built_in_React_hooks.md index 7f84be5..75f0545 100644 --- a/zk/Built_in_hooks.md +++ b/zk/Built_in_React_hooks.md @@ -2,7 +2,6 @@ tags: - typescript - react - - react-hooks --- # Typing built-in hooks diff --git a/zk/Child_to_parent_data_flow.md b/zk/Child_to_parent_data_flow_in_React.md similarity index 97% rename from zk/Child_to_parent_data_flow.md rename to zk/Child_to_parent_data_flow_in_React.md index ff229cc..492337a 100644 --- a/zk/Child_to_parent_data_flow.md +++ b/zk/Child_to_parent_data_flow_in_React.md @@ -1,5 +1,7 @@ --- -tags: [javascript, react, react-hooks] +tags: + - javascript + - react --- # Child to parent data flow diff --git a/zk/Comparing_classes_to_hooks.md b/zk/Comparing_React_classes_to_hooks.md similarity index 99% rename from zk/Comparing_classes_to_hooks.md rename to zk/Comparing_React_classes_to_hooks.md index 083b16f..ebb4bbb 100644 --- a/zk/Comparing_classes_to_hooks.md +++ b/zk/Comparing_React_classes_to_hooks.md @@ -2,8 +2,6 @@ tags: - javascript - react - - react-classes - - react-hooks --- # Comparing class components to hook-based components diff --git a/zk/Components_props_classes.md b/zk/Components_props_classes.md index 9e6ea17..51ba843 100644 --- a/zk/Components_props_classes.md +++ b/zk/Components_props_classes.md @@ -2,7 +2,6 @@ tags: - javascript - react - - react-classes --- # Components and props with class-based components diff --git a/zk/Components_props_hooks.md b/zk/Components_props_hooks_in_React.md similarity index 99% rename from zk/Components_props_hooks.md rename to zk/Components_props_hooks_in_React.md index 2f4fd48..1b702d5 100644 --- a/zk/Components_props_hooks.md +++ b/zk/Components_props_hooks_in_React.md @@ -2,7 +2,6 @@ tags: - javascript - react - - react-hooks --- # Components and props with hooks diff --git a/zk/Creating_a_Mongo_schema_and_model.md b/zk/Creating_a_Mongo_schema_and_model.md index 7e41585..58ce59e 100644 --- a/zk/Creating_a_Mongo_schema_and_model.md +++ b/zk/Creating_a_Mongo_schema_and_model.md @@ -11,7 +11,7 @@ tags: ## Schema In order start adding -[collections and documents](Introduction.md) to our database, +[collections and documents](MongoDB_Introduction.md) to our database, we use Mongoose's **schema** structure. (This is specific to Mongoose and is not a structure that is a part of Mongo in general.) diff --git a/zk/Custom_hook_examples.md b/zk/Custom_React_hook_examples.md similarity index 99% rename from zk/Custom_hook_examples.md rename to zk/Custom_React_hook_examples.md index 4b270e9..4357bb7 100644 --- a/zk/Custom_hook_examples.md +++ b/zk/Custom_React_hook_examples.md @@ -2,7 +2,6 @@ tags: - javascript - react - - react-hooks --- # Custom hook examples diff --git a/zk/Dates_in_Python.md b/zk/Dates_in_Python.md index a59b0a4..d3ac937 100644 --- a/zk/Dates_in_Python.md +++ b/zk/Dates_in_Python.md @@ -1,5 +1,7 @@ --- -tags: [python, timestamps] +tags: + - python + - time --- # Dates in Python diff --git a/zk/Deleting_documents.md b/zk/Deleting_Mongo_documents.md similarity index 88% rename from zk/Deleting_documents.md rename to zk/Deleting_Mongo_documents.md index 6a35bac..16aae8e 100644 --- a/zk/Deleting_documents.md +++ b/zk/Deleting_Mongo_documents.md @@ -1,5 +1,9 @@ --- -tags: [mongo-db, node-js, mongoose] +tags: + - mongo-db + - node-js + - mongoose + - databases --- # MongoDB: deleting a document from a collection diff --git a/zk/Importing_data.md b/zk/Importing_MongoDB_data.md similarity index 90% rename from zk/Importing_data.md rename to zk/Importing_MongoDB_data.md index 1e7f7c5..92c83b6 100644 --- a/zk/Importing_data.md +++ b/zk/Importing_MongoDB_data.md @@ -1,5 +1,8 @@ --- -tags: [mongo-db, node-js] +tags: + - mongo-db + - node-js + - databases --- # Importing data to MongoDB diff --git a/zk/Modelling_relationships.md b/zk/Modelling_relationships_in_MongoDB.md similarity index 98% rename from zk/Modelling_relationships.md rename to zk/Modelling_relationships_in_MongoDB.md index 3b1f0c8..4a1eb49 100644 --- a/zk/Modelling_relationships.md +++ b/zk/Modelling_relationships_in_MongoDB.md @@ -1,5 +1,9 @@ --- -tags: [mongo-db, node-js, mongoose] +tags: + - mongo-db + - node-js + - mongoose + - databases --- # Modelling relationships between data diff --git a/zk/Introduction.md b/zk/MongoDB_Introduction.md similarity index 97% rename from zk/Introduction.md rename to zk/MongoDB_Introduction.md index a6ed345..daf2efe 100644 --- a/zk/Introduction.md +++ b/zk/MongoDB_Introduction.md @@ -1,5 +1,7 @@ --- -tags: [mongo-db] +tags: + - mongo-db + - databases --- # MongoDB: Introduction diff --git a/zk/Querying_a_collection.md b/zk/Querying_a_Mongo_collection.md similarity index 98% rename from zk/Querying_a_collection.md rename to zk/Querying_a_Mongo_collection.md index b17e660..bd13214 100644 --- a/zk/Querying_a_collection.md +++ b/zk/Querying_a_Mongo_collection.md @@ -1,5 +1,9 @@ --- -tags: [mongo-db, node-js, mongoose] +tags: + - mongo-db + - node-js + - mongoose + - databases --- # Query a Mongo collection with Mongoose diff --git a/zk/Structuring_Express_applications.md b/zk/Structuring_Express_applications.md index 6289c37..79342e6 100644 --- a/zk/Structuring_Express_applications.md +++ b/zk/Structuring_Express_applications.md @@ -3,7 +3,6 @@ tags: - node-js - REST - APIs - - mongo-db --- # Structuring Express applications diff --git a/zk/Time_and_computers.md b/zk/Time_and_computers.md index ed1f92c..86de0ae 100644 --- a/zk/Time_and_computers.md +++ b/zk/Time_and_computers.md @@ -1,7 +1,9 @@ --- id: l29u title: Time_and_computers -tags: [unix] +tags: + - unix + - time created: Sunday, April 28, 2024 --- diff --git a/zk/Type_hinting.md b/zk/Type_hinting.md index 6010cfe..81a839b 100644 --- a/zk/Type_hinting.md +++ b/zk/Type_hinting.md @@ -1,5 +1,7 @@ --- -tags: [python, types] +tags: + - python + - data-types --- # Type hinting in Python diff --git a/zk/Update_document.md b/zk/Update_a_Mongo_document.md similarity index 94% rename from zk/Update_document.md rename to zk/Update_a_Mongo_document.md index 5cbe5be..c7edff0 100644 --- a/zk/Update_document.md +++ b/zk/Update_a_Mongo_document.md @@ -1,5 +1,9 @@ --- -tags: [mongo-db, node-js, mongoose] +tags: + - mongo-db + - node-js + - mongoose + - databases --- # Update a MongoDB document @@ -12,7 +16,7 @@ There are two methods for updating a document ## Query first document update With this approach we first execute a -[query](Querying_a_collection.md) to retrieve the document we +[query](Querying_a_Mongo_collection.md) to retrieve the document we want to edit and then make the change. We use the `findById` method to identify the document by its UUID and then `set` to update specified properties on the document. The `set` method is one of many operators that can be used to update diff --git a/zk/Validating_Mongoose_schemas.md b/zk/Validating_Mongoose_schemas.md index af90cc5..9cc166d 100644 --- a/zk/Validating_Mongoose_schemas.md +++ b/zk/Validating_Mongoose_schemas.md @@ -1,5 +1,9 @@ --- -tags: [mongo-db, mongoose, node-js] +tags: + - mongo-db + - mongoose + - node-js + - databases --- # Validating Mongoose schemas diff --git a/zk/useContext.md b/zk/useContext.md index ae008c3..f4c3c62 100644 --- a/zk/useContext.md +++ b/zk/useContext.md @@ -124,4 +124,4 @@ Then, in our code we just insert the `Context` component: In the examples above we have only been consuming state that is owned by the provider however in most scenarios you will also want to update the state from a consumer. This is best achieved by combining `useContext` with a reducer and is -detailed in [Application state management](Application_state_management.md). +detailed in [Application state management](Application_state_management_with_React_hooks.md).