摘要:
## node连接数据库
1. npm init
2. npm install mongodb(默认最新版)
3. npm remove mongodb删除安装过的模块
4. npm info mongodb(mongodb的版本信息)
5. npm install mongodb@1.2.3(安装具体版本号)
### 查:
~~~
const { MongoClient } = require("mongodb");
//MongoClient是MongoDB的客户端
MongoClient.connect("mongodb://127.0.0.1:27017/1722", (err,db) => {
//connect是MongoDB的一个方法,用来帮助和服务器建立连接
const collection = db.collection("user")
//db.collection MongonDB自带方法
collection.find({}, {_id:0, name:1}).toArray((err,result) =&g 阅读全文
该文被密码保护。 阅读全文
该文被密码保护。 阅读全文
该文被密码保护。 阅读全文
摘要:
abs() 可以返回绝对值 //console.log( Math.abs(+10) ); //10 //console.log( Math.abs( 10) ); //10 ceil() 对一个数进行上舍入 //console.log( Math.ceil(5.3) ); //6 //consol 阅读全文
该文被密码保护。 阅读全文
该文被密码保护。 阅读全文
该文被密码保护。 阅读全文
该文被密码保护。 阅读全文
摘要:
查看源代码 有页面中所搜索的文字证明是后端渲染,没有证明是前端动态创建 流程图 请求服务器 ———— 服务器返回一个html ———— 浏览器解析html ↑ json | ↑ | | ↓ 后端渲染 ↓ js重新渲染页面 ———— 执行js逻辑 ———— 加载css.js ↓ 前端创建 node n 阅读全文