Installation of MongoDB visualizer and start of server
Install MongoDB and start server
1.Download mongoDB service: (version 3.1.2)
2. Install - > select custom - > install next
3. Create a new empty directory on the local disk. The location should not be too deep. For example, C:\db is used to store data files
4. Run mongoDB service: enter the bi ...
Posted on Sat, 13 Jun 2020 03:30:44 -0400 by andy75180
nodejs basic tutorial - simple blog (9) - paging
design sketch:
Analysis of this renderings, combined with previous tutorials we know. The navigation bar inherits "layout.html" and the table is "user [index. HTML". The paging button is the content of this lesson. Encapsulate it in 'page.htnl';
First, create a new file views/admin/page.html
...
Posted on Mon, 04 May 2020 23:47:06 -0400 by RickChase
Day 25 of egg learning notes: mongoose predefined pattern modifiers Getters and Setters custom modifiers
1, mongoose predefined pattern modifier.
lowercase,uppercase,trim
The predefined pattern modifiers provided by mongoose can format our added data.
① , create new news.js under the db folder, connect to the database, and export newsModel.
var mongoose = require("./db.js");
// Define data table (Collection) mapping, note: field names must ...
Posted on Sun, 03 May 2020 22:13:59 -0400 by kyberfabrikken
The use case of GraphQL in koa2 server
1, Create project
1. Install some packages
npm install koa --save
npm install isodate --save
npm install koa --save
npm install koa-bodyparser --save
npm install koa-router --save
// Handling cross domain roles
npm install koa2-cors --save
npm install mongoose --save
// These two are the syntax of ES6
npm install ba ...
Posted on Fri, 01 May 2020 16:02:19 -0400 by tappy
mongoose, ajax, express, pagination plug-ins to achieve paging effect
1. Download pagination plug-in first. Download address: JQuery paging plug-in
2. After downloading, add in the page, including CSS and JS files: the HTML part and JS part are as follows
<link rel="stylesheet" href="/public/css/pagination.css"/>
<div class="page">
<div class="m-s ...
Posted on Sun, 01 Mar 2020 22:21:07 -0500 by ksmatthews
Art template + Express + mongodb small project
Preface
In order to experience the content of front-end and back-end interaction, I found art template + Express + mongodb( Code GitHub - > https://github.com/molifenge/selfblog )This simple small project practice hands, the page is extremely simple, do not like to spray. This project is mainly dev ...
Posted on Sun, 23 Feb 2020 04:37:54 -0500 by PHPnewb_JavaAdept
vue koa2 mongodb does the back-end part of the personal blog login registration function from scratch
0. Effect demonstration
It's annoying to plug in a video.You can go out and turn right to Youku. Click on me!).
1. Backend Build
1.1 Project Structure
First look at the server directory on the back end
Explain one by one
First, the dbs folder, as its name implies, operates on the database, and modules is the mongoose model that operates on ...
Posted on Sat, 18 Jan 2020 12:49:51 -0500 by kris81
Recommended collection: Node.js project architecture that should not be missed
Express.js is a great framework for developing the Node.js REST API, but it does not give you any clues about how to organize your Node.js project.
It sounds silly, but it's a problem.
Proper organization of the Node.js project structure will avoid duplication of code and improve the stability and scalability of services.
This article is based ...
Posted on Fri, 13 Dec 2019 19:12:03 -0500 by englishman69
Getting started with express+mongodb under react
Express:
express is used to develop web interfaces
Install: npm install express --save
//Directory: server/server.js
const express = require('express');
// New app
const app = express();
app.get('/', (req, res)=>{
res.send('<h1>Hello world!</h1>')
})
app.get('/', (req. res)=& ...
Posted on Sun, 08 Dec 2019 22:23:17 -0500 by wgh
Fifth populate of mongoose series
Effect
Mongoose's populate() can join tables to query, referencing documents in other collections.
Populate() automatically replaces the specified field in the document, and the replacement content is obtained from other collection s.
refs
When you create a Model, you can set the ref option for fields in that Model that are associated to store ...
Posted on Fri, 29 Nov 2019 02:21:08 -0500 by Derokorian