Some problems of writing interface with mongoose to swagger

Before there was a project, the leader said that I used mongoose to swagger to write down the back-end interface. Although I had not written the back-end interface before, I wanted to have colleagues and accepted the work happily. First to ask colleagues, and then... Have not used; so Baidu to see if there is a relevant tutorial 😭 , well, it's ...

Posted by Gorillas on Thu, 11 Jun 2020 22:56:59 -0700

The 37th day of eggjs learning notes: the second part of RBAC on the rights management of the post management system of eggjs

1, Role addition, deletion, modification and query ① Create a new schema about role table, model > role.js Next new role.js , type the following code: module.exports = app => { const mongoose = app.mongoose; const Schema = mongoose.Schema; var d = new Date(); const RoleSchema = new Schema({ title: { type: String }, ...

Posted by nilansanjaya on Sun, 24 May 2020 08:29:34 -0700

The 37th day of eggjs learning notes: the second part of RBAC on the rights management of the post management system of eggjs

1, Role addition, deletion, modification and query ① Create a new schema about role table, model > role.js Next new role.js , type the following code: module.exports = app => { const mongoose = app.mongoose; const Schema = mongoose.Schema; var d = new Date(); const RoleSchema = new Schema({ title: { type: String }, ...

Posted by 555sandy on Sun, 24 May 2020 08:29:45 -0700

Day 29 of egg learning notes: using mongoose in eggjs

1, Mongoose in egg 1. Installing mongoose in an egg project cnpm i mongoose --save 2. Configure the eg mongoose plug-in in config > plugin.js exports.mongoose = { enable: true, package: "egg-mongoose" }; 3. Configure the database connection address in config > config.default.js config.mongoose = { client: { // url ...

Posted by abisai on Mon, 11 May 2020 10:12:07 -0700

24 days of egg learning notes: mongoose default parameters, modular

1. mongoose default parameter: when adding data, if no data is passed in, the data configured by default will be used. Connect to the database, a warning is reported below, useNewUrlParser:true This attribute will identify the db needed to verify the user in the url. You do not need to specify it before upgrading. You must specify it before u ...

Posted by grungefreak on Sun, 03 May 2020 08:26:24 -0700

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