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

mongodb / morgan save log

Save logs in log files // app.js var logger = require('morgan'); var fs = require('fs') var logDirectory = path.join(__dirname, 'log') fs.existsSync(logDirectory) || fs.mkdirSync(logDirectory) var accesLogStream = FileStreamRotator.getStream({ date_format: 'YYYYMMDD', filename: path.join(logDirectory, 'access-%DATE%.log'), frequency: 'dai ...

Posted by newjsguy on Fri, 30 Aug 2019 21:54:39 -0700

How can I quickly set up a short-link service?

Summary: A simple short-link tutorial. Original: Ten minutes for short-link service (Node + Express + MongoDB) Author: MudOnTire Fundebug Copyright shall be owned by the original author when authorized to reproduce. We have used short links more or less. The so-called short links are short links generated from the long original link url. Vis ...

Posted by stride-r on Thu, 22 Aug 2019 19:01:35 -0700

Using session within the express framework

The last article mentioned the shortcomings of cookie s and suggested that session is one way to solve the shortcomings.This article tells you how to use session. The author used the file save session method.If you don't want to save in memory or database, remember to use the appropriate module. Below are two ways to use memory storage and fil ...

Posted by citricsquid on Tue, 30 Jul 2019 09:24:20 -0700