ちょうきょう666

导航

2021年3月1日

JavaFreemarker01快速上手

摘要: 在主类中 1 package com.zhang; 2 3 import java.io.IOException; 4 import java.io.OutputStreamWriter; 5 import java.util.HashMap; 6 import java.util.Map; 7 8 阅读全文

posted @ 2021-03-01 20:15 ちょうきょう666 阅读(75) 评论(0) 推荐(0) 编辑

7、验证信息

摘要: 1 const mongoose=require('mongoose') 2 3 mongoose.connect("mongodb://localhost/playground",{ useNewUrlParser: true,useUnifiedTopology: true}) 4 .then( 阅读全文

posted @ 2021-03-01 20:02 ちょうきょう666 阅读(95) 评论(0) 推荐(0) 编辑

6、更新文档

摘要: 1 const mongoose=require('mongoose') 2 3 mongoose.connect("mongodb://localhost/playground",{ useNewUrlParser: true,useUnifiedTopology: true}) 4 .then( 阅读全文

posted @ 2021-03-01 19:20 ちょうきょう666 阅读(30) 评论(0) 推荐(0) 编辑

5、删除文档

摘要: //删除查到的一条文档 //如果匹配多条文档,会删掉一开始的一条 //返回被删除的文档 Course.findOneAndDelete({}).then(result=>{console.log(result)}) //删除多个 Course.deleteMany({}).then(result=> 阅读全文

posted @ 2021-03-01 13:50 ちょうきょう666 阅读(70) 评论(0) 推荐(0) 编辑

4、查询文档02

摘要: //$gt是大于的意思,$lt是小于的意思 Course.find({age:{$gt:20,$lt:40}}).then(result=>{console.log(result)}) //$in包含的意思,差爱好里包含足球的字段 Course.find({hobbies:{$in:['足球']}} 阅读全文

posted @ 2021-03-01 13:41 ちょうきょう666 阅读(31) 评论(0) 推荐(0) 编辑

3、查询文档01

摘要: 1 const mongoose=require('mongoose') 2 //链接数据库,成功运行then里面的代码,错误运行catch里面的代码 3 mongoose.connect("mongodb://localhost/playground",{ useNewUrlParser: tru 阅读全文

posted @ 2021-03-01 13:26 ちょうきょう666 阅读(43) 评论(0) 推荐(0) 编辑

2、插入数据的另一种方法

摘要: const mongoose=require('mongoose') //链接数据库,成功运行then里面的代码,错误运行catch里面的代码 mongoose.connect("mongodb://localhost/playground",{ useNewUrlParser: true,useU 阅读全文

posted @ 2021-03-01 13:02 ちょうきょう666 阅读(45) 评论(0) 推荐(0) 编辑

1、连接数据库,插入数据

摘要: 1 const mongoose=require('mongoose') 2 //链接数据库,成功运行then里面的代码,错误运行catch里面的代码 3 mongoose.connect("mongodb://localhost/playground",{ useNewUrlParser: tru 阅读全文

posted @ 2021-03-01 12:55 ちょうきょう666 阅读(88) 评论(0) 推荐(0) 编辑