Using Node to operate MongoDB

1. Use MongoDB module for operation First, install the mongodb module in the working directory, 1 cnpm i mongodb//Lead in module const MongoClient = require('mongodb').MongoClient; //Write connection string,My database address is as follows,So when you're writing, just change the address const DB_CONN_STR= 'mongodb://127.0.0.1/demo'; //Remem ...

Posted on Sat, 02 May 2020 15:31:39 -0700 by daimoore

nodejs+express+mongodb: a simple attempt to write api interface

1: Start mongodb service My mongoDB installation directory: E:\mongoDB\bin, version: 3.4.9 Open cmd - > e: (enter e disk) - > CD mongoDB / bin (enter bin folder under mongoDB) - > mongod.exe (start mongod first) - > Mongo (then mongo)   2: Start the visualization tool of mongoDB, adminMongo The installation directory of adminMongo ...

Posted on Sun, 05 Apr 2020 11:04:22 -0700 by studio805

Mongoose and Redis installation and use

I. Introduction to MongoDB Install Mongoose brew tap mongodb/brew brew install mongodb-community brew services start mongodb-community Check whether the installation is successful: which mongod Launch project: mongod Here, the mac system may fail to create related folders due to system upgrade. Here you just need to turn off SIP protection and ...

Posted on Fri, 06 Dec 2019 02:43:42 -0800 by tkm

Using mongoose paginate V2 to query the slow problem

scene mongoose-paginate-v2 is a paging plug-in on mongoose. I have used it many times, but I have encountered problems in creating projects recently. The old code does not use paging plug-ins to query, and then uses middleware to paging.old codes, 16ms @Get('') public async index(@Query() query, @Pager() pager: any, @Req() req: Request, @Re ...

Posted on Fri, 25 Oct 2019 10:14:28 -0700 by stride-r

A Probe into koa-session Source Code

Introduction Now that you've dug a hole, you have to fill it in. In the previous article on Authentication of Next, we talked about how to use koa-session, mainly configuring and changing the content of session. Let's review it. This is the configuration file. app.use( session( { key: "lxg", overwrite: true, //Overwrite Cookie ...

Posted on Thu, 10 Oct 2019 05:39:40 -0700 by ankurcse

Learning Summary of Basic Use of Mongoose Module

Learning Summary of Basic Use of Mongoose Module Mongoose is a database management tool module of MongoDB in Node environment, which can transform data in the database into Js objects. Installation and Connection of Database Install using npm package management tools. npm i mongoose The introduction ...

Posted on Fri, 04 Oct 2019 00:52:25 -0700 by mashamit

Navigation Website Collection and Navigation Platform

original intention It is estimated that many people, like minor editors, initially collect the websites they have visited into the browser's collection folder. Over the years, there are more and more websites, and it is more and more difficult to find the required websites in the collection folder. Later, the browser moved from Firefox to Chro ...

Posted on Thu, 05 Sep 2019 00:56:06 -0700 by ari_aaron

Nodejs Road-MongoDB&MySQL

MongoDB 1.1 Overview MongoDB is a database based on distributed file storage. Written in C++ language. The aim is to provide a scalable and high performance data storage solution for WEB applications. MongoDB is a product between relational database and non-relational database, which has the most abundant functions and resembles relational ...

Posted on Mon, 22 Jul 2019 05:51:24 -0700 by bznutz

Node.js Implementing Simple Crawler

Why did you choose to use node to write crawlers? Just because cheerio is a library that is fully compatible with jQuery grammar, it's really cool to use if you're familiar with it. Dependent Choice cheerio Node.js version of jQuery Http: Encapsulates an HTPP server and a simple HTTP client iconv-lite To solve the problem of scrambling gb2312 ...

Posted on Wed, 17 Jul 2019 12:52:13 -0700 by jackiw

Express+MongoDB Step by Step'Win'

prelude What is Express? Express is a minimalist and flexible web application development framework based on Node.js platform, which provides a series of powerful features to help you create a variety of Web and mobile applications. Global Installation express Scaffolding $ npm install express-generator -g Create express Project $ express myapp ...

Posted on Mon, 15 Jul 2019 17:33:50 -0700 by jubripley