Simple configuration and database connection of NodeJS build project

Simple configuration and database connection of NodeJS build project The main contents are as follows: Load exprss module Create app app Load template processing Set up static file hosting Load database module Blog offline Processing post requests Cookie settings Load exprss module var express = require('express ...

Posted by keevitaja on Tue, 31 Mar 2020 06:57:39 -0700

mongoose - the Nodejs framework of object-oriented operation mongodb

introduce Whether mysql or mongodb, the traditional way to interact with database is to write code according to the API they provide. The APIs they provide are often not easy to understand and hard to remember. If you pass wrong parameters and write a wrong symbol, you need to check the document. The ORM (Object Relational Mapping) framework ...

Posted by jollyjumper on Sat, 07 Mar 2020 08:35:50 -0800

Using the express write interface

1, Interface development specification (Restful API) 1. Clear needs Function: to ensure that everyone's writing specifications are the same Give an example: The back end publishes the resource to the URL - > the front end accesses the resource through the URL - > and indicates the operation ...

Posted by nivosh on Thu, 05 Mar 2020 01:23:39 -0800

Redux information perfect interaction

Interaction requirements: improve the background interaction of information page, redux sends update data request to realize asynchronous update of user data of state tree, detects whether information supplement has been completed each time when entering the perfect information page, if it has been completed, directly jump to t ...

Posted by fooDigi on Fri, 31 Jan 2020 15:22:15 -0800

Review the basic use of mongoose

mongodb reference mongoose official website mongoose is more convenient to use Using mongodb data driver to write an error log For more information on the official data-driven mongodb of node asset assertion is not used here import mongodb from 'mongodb' const MongoClient = mongodb.MongoClient const url = 'mongodb://localhost:27017/edu' expor ...

Posted by dannyluked on Fri, 24 Jan 2020 07:08:14 -0800

Node learning notes optimization crud addition, deletion, modification and query

This article combines the previous< Node learning notes Mongodb and Mongoose >Yes curd example Optimize MongoDB installation Download address of installation file:[ https://www.mongodb.com/download-center/community] To install MongoDB on Windows: https://www.runoob.com/mongodb/mongodb-window-install.html Special attention should be paid d ...

Posted by bashaash on Wed, 18 Dec 2019 14:12:30 -0800

Replace node JS express view engine jade with html

The default view engine generated by express project is jade. At that time, I preferred html pages in development, so this article introduces how to replace the default view engine jade of express with html Step 1: open the app.js file of the project. The contents of the app.js are as follows: var createError = require('http- ...

Posted by seanrock on Sun, 01 Dec 2019 08:23:54 -0800

Query in mongoose

find() Model.find(filter[, projection][, options][, callback]) Parameter 1: filter The query condition uses the format of JSON document, and the syntax of JSON document follows MongoDB shell The same is true. { field1: value1, field2: { operator: value2 } ... } 1. Find all Model.find() Model.find({}) 2. Accurate search Model.find({author:'dora' ...

Posted by lplatz on Thu, 14 Nov 2019 22:29:05 -0800

Forum and background built with node+mongodb

Forum and background built with node+mongodb This is the first project background that I have done. If there are any inappropriateness and correction, please give me more advice. This project is only for reference! Thank you. I put the source code at the bottom of the article. If you need it, you can ...

Posted by curb on Sun, 27 Oct 2019 05:23:53 -0700

Notes on node.js+mongodb+express to realize simple version of blog management system

I. Case initialization Related folders public: static resources model: database related files Route: route views: template files Build project description file npm init -y Download third party module npm i express mongoose art-template express-art-template Create server const express = require ...

Posted by richo89 on Sat, 26 Oct 2019 00:26:17 -0700