摘要: ## 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 阅读全文
posted @ 2017-12-28 11:06 lhh-bky 阅读(20) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2017-12-27 16:33 lhh-bky 阅读(19) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2017-12-26 16:09 lhh-bky 阅读(44) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2017-12-25 21:49 lhh-bky 阅读(40) 评论(0) 推荐(0) 编辑
摘要: abs() 可以返回绝对值 //console.log( Math.abs(+10) ); //10 //console.log( Math.abs( 10) ); //10 ceil() 对一个数进行上舍入 //console.log( Math.ceil(5.3) ); //6 //consol 阅读全文
posted @ 2017-12-06 15:27 lhh-bky 阅读(142) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2017-12-06 15:24 lhh-bky 阅读(18) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2017-12-06 15:17 lhh-bky 阅读(26) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2017-12-06 15:11 lhh-bky 阅读(10) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2017-12-06 14:58 lhh-bky 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 查看源代码 有页面中所搜索的文字证明是后端渲染,没有证明是前端动态创建 流程图 请求服务器 ———— 服务器返回一个html ———— 浏览器解析html ↑ json | ↑ | | ↓ 后端渲染 ↓ js重新渲染页面 ———— 执行js逻辑 ———— 加载css.js ↓ 前端创建 node n 阅读全文
posted @ 2017-11-27 17:41 lhh-bky 阅读(162) 评论(0) 推荐(0) 编辑