mongoDB的学习:

1.mongodb 安装及使用

mongodb 安装及使用__mongodb安装使用

MongoDB社区下载

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-4uR9zPSq-1655092482405)(https://gitee.com/ljq4551/picgo/raw/master/20220613114232.png)]

配置环境变量,使在任意位置都可以执行bin下的exe程序

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-tim20p8E-1655092482407)(https://gitee.com/ljq4551/picgo/raw/master/20220613114226.png)]

配置完成后,这样就成功了。

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-JGnfMX6J-1655092482408)(https://gitee.com/ljq4551/picgo/raw/master/20220613115205.png)]

2.开始整合springboot+mongoDB

1.导入依赖

<!--  mongodb依赖      --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-mongodb</artifactId></dependency>

2.添加mongodb配置yaml配置

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-LzGTY7Yo-1655092482408)(https://gitee.com/ljq4551/picgo/raw/master/20220613114213.png)]

  #mongodb配置spring:data:mongodb:host: localhostport: 27017#      mongodb数据库名称database: monge_demo

3.新增实体类对应mongodb的集合进行关系映射

package com.ljquan.test.pojo.mongoDB;import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;import java.util.Date;/*** @className Article* @Description 文章  用于mongodb的测试* @Author ljquan* @Date 2022-06-10 11:39:02* @Version 1.0.0*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Article {/*** 文章id*/@Idprivate Long id;/*** 用户ID*/private Long userId;/*** 文章标题*/private String title;/*** 文章内容*/private String content;/*** 创建时间*/private Date createTime;/*** 更新时间*/private Date updateTime;/*** 点赞数量*/private Long thumbUp;/*** 访客数量*/private Long visits;}

4.开始使用Mongodb和springboot整合

创建ArticleService接口

package com.ljquan.test.service.mongoDB;import com.ljquan.test.pojo.mongoDB.Article;
import org.springframework.stereotype.Service;import java.util.List;/*** @className ArticleService* @Description 服务条* @Author ljquan* @Date 2022-06-10 13:54:33* @Version 1.0.0*/
@Service
public interface ArticleService {/*** 插入文章* 插入** @param article 文章* @return int*/int insertArticle(Article article);/*** 更新文章** @param article 文章* @return int*/int updateArticle(Article article);/*** 删除文章** @param id id* @return int*/int removeArticle(Long id);/*** 找到所有** @param article 文章* @return {@code List<Article>}*/List<Article> findAll(Article article);/*** 找到一个** @param article 文章* @return {@code Article}*/Article findOne(Article article);/*** 找到喜欢** @param article 文章* @return {@code List<Article>}*/List<Article> findLike(Article article);/*** 找到更多** @param article 文章* @return {@code List<Article>}*/List<Article> findMore(Article article);}

创建实现类ArticleServiceImpl

package com.ljquan.test.service.mongoDB.impl;import cn.hutool.core.date.DateUtil;
import com.ljquan.test.pojo.mongoDB.Article;
import com.ljquan.test.service.mongoDB.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Service;import java.time.LocalDateTime;
import java.util.List;
import java.util.regex.Pattern;@Service
public class ArticleServiceImpl implements ArticleService {@AutowiredMongoTemplate mongoTemplate;/*** 插入文章** @param article 文章* @return int*/@Overridepublic int insertArticle(Article article) {try {article.setCreateTime(DateUtil.date());mongoTemplate.insert(article);return 1;} catch (Exception e) {e.printStackTrace();return -1;}}/*** 更新文章** @param article 文章* @return int*/@Overridepublic int updateArticle(Article article) {//通过query根据id查询出对应对象,通过update对象进行修改Query query = new Query(Criteria.where("_id").is(article.getId()));//更改信息Update update = new Update().set("username", article.getTitle());try {mongoTemplate.updateFirst(query, update, Article.class);return 1;} catch (Exception e) {e.printStackTrace();return -1;}}/*** 删除文章** @param id id* @return int*/@Overridepublic int removeArticle(Long id) {Query query = new Query(Criteria.where("_id").is(id));try {mongoTemplate.remove(query, Article.class);return 1;} catch (Exception e) {e.printStackTrace();return -1;}}/*** 找到所有** @param article 文章* @return {@code List<Article>}*/@Overridepublic List<Article> findAll(Article article) {Query query = new Query(Criteria.where("_id").is(article.getId()));return mongoTemplate.findAll(Article.class, article.getTitle());}@Overridepublic Article findOne(Article article) {Query query = new Query(Criteria.where("_id").is(article.getId()));return mongoTemplate.findOne(query, Article.class);}/*** 模糊查询** @param article 文章* @return {@code List<Article>}*/@Overridepublic List<Article> findLike(Article article) {//设置Pattern pattern = Pattern.compile("^.*" + article.getContent().trim() + ".*$", Pattern.CASE_INSENSITIVE);Query query = new Query(Criteria.where("content").regex(pattern));return mongoTemplate.find(query, Article.class);}/*** 找到更多** @param article 文章* @return {@code List<Article>}*/@Overridepublic List<Article> findMore(Article article) {Query query = new Query(Criteria.where("content").is(article.getContent()));return mongoTemplate.find(query, Article.class);}}

这里是最重要的,调用了刚刚导入进来的依赖,然后调用里面的接口实现整合

@Autowired
MongoTemplate mongoTemplate;

5.测试

   @AutowiredArticleServiceImpl articleService;/*** 测试发现相似*/@Testpublic void testFindLike() {Article build = Article.builder().content("7").build();List<Article> like = articleService.findLike(build);System.out.println(like.size());like.forEach(article -> {System.out.println(article.getContent());});}/*** 测试插入文章*/@Testpublic void testInsertArticle() {Article build = Article.builder().content("7").id(snowflake.nextId()).createTime(DateUtil.date()).thumbUp(9L).updateTime(DateUtil.date()).build();int i = articleService.insertArticle(build);log.info("【article】= {} 插入成功", JSONUtil.toJsonStr(build));}/*** 测试发现所有*/@Testpublic void testFindAll() {List<Article> all = articleService.findAll();log.info(all + " ");}……

6.MongoDB数据库输出结果

2022-06-13 11:29:53.704 [main] INFO  org.mongodb.driver.connection - Opened connection [connectionId{localValue:3, serverValue:15}] to localhost:27017
2022-06-13 11:29:53.781 [main] INFO  com.ljquan.test.TestApplicationTests - [Article(id=1, userId=1535106423837560832, title=wwigzpxj10u8hda1zs8l更新之后的标题, content=mmcxzb9ookzl6jegxnrp53hicmo0t6onch0mcwlqpk6s2kqzpgie0pqrcb2ps9v3ut40ypqwht9kgwj6fjovpc3bmt2j8vx5qpmtud9uxslp04pe0oy9etu4018xe9xe7nl7t2bmojkj9nre6m8odj, createTime=Fri Jun 10 11:47:47 CST 2022, updateTime=Fri Jun 10 13:36:59 CST 2022, thumbUp=0, visits=0), Article(id=1535134388424151040, userId=1535134388424151041, title=ok94ysuekznpuwmi7puo, content=vvbfxw4mn0538vso42aktg6botfn17ro8bc0z58byb0mk22wfimbxcpgo273m7bzj6qs31kamu8p777kze6sarj8feywu1i77332ajauatu2rmi1aj96zmaukpqug6ovskws4xfq6wfrh8m3ut3iig, createTime=Fri Jun 10 13:38:54 CST 2022, updateTime=Fri Jun 10 13:38:54 CST 2022, thumbUp=0, visits=0), Article(id=1535134388495454208, userId=1535134388495454209, title=wqy8byd12n8p2pekl26n, content=bbzvqheql3qpwk9b6ju2r59srzekpvy4q2qglpxuyzc70nclfwulhzxmuqugoof7xx3jpfzhy1kkvklg9mqd6gqmqub39vht7fz9mf7ncwot3uazfzcgvuvm3icii3o5zcizlufrep6z9jau4likvb, createTime=Fri Jun 10 13:38:54 CST 2022, updateTime=Fri Jun 10 13:38:54 CST 2022, thumbUp=0, visits=0), Article(id=1535134388495454210, userId=1535134388495454211, title=bgpu1j0cmkswc02c3ghl, content=g8s6hf1wwipxg59ygqezn0h0e9wbynw2ju1ad3b4dd71188gaqu01oohbdhj4rchukf25gl8x4jiw2jhxtrkbexxobmvcn70lcos12gdzyrjmbkhxcruxdvectx0gpaxvnf3fjuwu28udyzo69q7nl, createTime=Fri Jun 10 13:38:54 CST 2022, updateTime=Fri Jun 10 13:38:54 CST 2022, thumbUp=0, visits=0), Article(id=1535134388495454212, userId=1535134388495454213, title=co8khj1kh4dw8fw1oxht, content=2b2ta1w52olvaavmvhmtlsgynkeux8ps87h64sjqmdy6eud0l5zh81yihtegegsvwxkbp5pamcldmwynrdiswfli75z4lcau5v210mxjlmat78rdloqsqfobwhr1f5cxo0217c7g8mqzeglzklf0rf, createTime=Fri Jun 10 13:38:54 CST 2022, updateTime=Fri Jun 10 13:38:54 CST 2022, thumbUp=0, visits=0), Article(id=1535134388495454214, userId=1535134388495454215, title=qp0cvb1rzfafoxscnbgr, content=rdhw4ys2mwsfzaa0vzdp7p1ufs1tk29yypdsiwvbnx7j2pglkljlkerd1myamiqr2r3o858qjjxzhra94073xft66ynri3up3nwhut9o4zkkkdtvz5nfmsyzb4usqr3e4u66ym2fhfuvczwbrz181p, createTime=Fri Jun 10 13:38:54 CST 2022, updateTime=Fri Jun 10 13:38:54 CST 2022, thumbUp=0, visits=0), Article(id=1535134388495454216, userId=1535134388495454217, title=gdykjbb6hipcsdkukdza, content=1616z4cpwq4cse7q19qj1ft7j3vegn03b2mfmrsjseylh8mv1qc3ntybiebb40ifubx8yr4muxlkvjb8dwi08flplg97mi63a95zxmq3rfam4lc5ckub6cih1cui9mse8qn28jbm3mtvu5ewv5xcd0, createTime=Fri Jun 10 13:38:54 CST 2022, updateTime=Fri Jun 10 13:38:54 CST 2022, thumbUp=0, visits=0), Article(id=1535134388495454218, userId=1535134388495454219, title=sbybn8n133q9ahh6hys4, content=z6zpdwvegw0o8txuo5ze1un316qulemjgvodctl0rkea40y0wfccf19nfmxqgk2w1ivfg0rzu11zot1hmhx08dqxpzsrwxts26oglz8mf4ojeupuqryiqohfyvnu5eg4uni4pklxrmmuzowi9net64, createTime=Fri Jun 10 13:38:54 CST 2022, updateTime=Fri Jun 10 13:38:54 CST 2022, thumbUp=0, visits=0), Article(id=1535134388495454220, userId=1535134388495454221, title=mo77ot1lnqnmjf37sh1u, content=mnm8w3fkh2gu1mabhlqw2jaobs7p5p171w5c1218khsjxk5o5dwg76hdgddhrpa54ht5mjth1e4hhof3p9wem9pfn9ehkn2pr0gvc647wq2f4h5fw0lwm5y1n67yif9aru652r8qjq2hfsldqr0pci, createTime=Fri Jun 10 13:38:54 CST 2022, updateTime=Fri Jun 10 13:38:54 CST 2022, thumbUp=0, visits=0), Article(id=1535134388495454222, userId=1535134388495454223, title=nepwd773h61rl2ygz354, content=zsw3kj1t6qsubxrp7wv9vl3e9ox8ueiyl1pt54z3o6y3gn7owakgqhz5n46jaa8i2tzt9467g4g6zrg3qxo3370kzqxgenub2xsptf6zjla3cykqoap82gg1cdnaik01npqj5pl9rsawbw6kx7xqz9, createTime=Fri Jun 10 13:38:54 CST 2022, updateTime=Fri Jun 10 13:38:54 CST 2022, thumbUp=0, visits=0), Article(id=1535134388495454224, userId=1535134388495454225, title=j647o22eewc0pyykfazg, content=q358f95wc252ggqjdrwpttle4o7xr4zx76askzcvedf3hv7t40ddknpxnomzkuhmmykvnqhloi9fsl7gxkl19b45hnsnd7ltb3td3ghcnh0bpx2a4wagcyhwniug5lgynqi3q0nq0b1ujgoi1zfz11, createTime=Fri Jun 10 13:38:54 CST 2022, updateTime=Fri Jun 10 13:38:54 CST 2022, thumbUp=0, visits=0), Article(id=1535135113699004416, userId=1535135113699004417, title=9wewx985ayf6m9ny4fbj标题0, content=4dqumthlfqjunoi26gc5sl2r57lasvae9vmsugl5eevau9mi1hicu0kanhmauh972o8bsixs8vmgmq7embcjgx79ys6q7e5utknya5jl2pnb715w15v88d5rf0mfkey8gzzq9p1nvi1j9s8e8evfyq内容0, createTime=Fri Jun 10 13:41:47 CST 2022, updateTime=Fri Jun 10 13:41:47 CST 2022, thumbUp=0, visits=0), Article(id=1535135113787084800, userId=1535135113787084801, title=4ko0ffg21ymplfnza7zw标题1, content=wwe94h9tplhiyg9inrrxeexinnb821ai80uxlmyyml1ipvwbwcf444buqfxluzpj5wkz969optqty6y7eup5ggx8h19ewq7mk6bnt14mlbq4zputac137rebqwq3af7rt4apeh61i8306760wydau9内容1, createTime=Fri Jun 10 13:41:47 CST 2022, updateTime=Fri Jun 10 13:41:47 CST 2022, thumbUp=0, visits=0), Article(id=1535135113787084802, userId=1535135113787084803, title=xoqmm0z43rj9f6fwvsnw标题2, content=rgadlme0y9baqtc19i2nmzvlgaq10xmh4aeqv47b3olsv0qqidzyfm6hcidu9gfebg4rokck5z5i5rmr91fpx2ihpefhmwl8zdb3zk6bxixuxh1xuxad0w7to7wvs0z1mc71udz1rcl9efq2kbkuea内容2, createTime=Fri Jun 10 13:41:47 CST 2022, updateTime=Fri Jun 10 13:41:47 CST 2022, thumbUp=0, visits=0), Article(id=1535135113787084804, userId=1535135113787084805, title=xk0efgub8c6ujki0otkn标题3, content=wizywv8pi4q99o2f7m5vyqoi574lg45wwevf4wzmwtz839r0h0dwzib71plqdy8nehw7wvgxjpq2ps1v9d91cqi9e1bkwfyr13i37jty6ttvtyzoip0baxp9rjxcyb2n28x0jz74dbffl3if26hi39内容3, createTime=Fri Jun 10 13:41:47 CST 2022, updateTime=Fri Jun 10 13:41:47 CST 2022, thumbUp=0, visits=0), Article(id=1535135113787084806, userId=1535135113787084807, title=5k6j5d2bm1z8ktakv98f标题4, content=j14aje94frhy84c7vbvdscehull4pxl3cejedyh0iex1lg79qzuf26tovjdfaxn1xus0vcivetqd2p2vscrqy1tuwu293cqnhcf5tme7wujlkufjb3mtbfxiw3on9r0saeg274j42hxbxzoq9wkoi6内容4, createTime=Fri Jun 10 13:41:47 CST 2022, updateTime=Fri Jun 10 13:41:47 CST 2022, thumbUp=0, visits=0), Article(id=1535135113787084808, userId=1535135113787084809, title=drjloecdia10f89yf0bj标题5, content=hwk9op2lohgn11axe4e27l2rdzrakmedvqi70hwssyec5ecjskpah8wzdgax9wopsu6xdwx7jxw9oebeat5esejgsl3f63bwbhg6yjhdx2e3vgnixhfb9snkqwg3l427cygiy8suqqyeg639kctki1内容5, createTime=Fri Jun 10 13:41:47 CST 2022, updateTime=Fri Jun 10 13:41:47 CST 2022, thumbUp=0, visits=0), Article(id=1535135113787084810, userId=1535135113787084811, title=hykpbq08iucw62qe90vz标题6, content=dhwanhbjbj8vtwqhpcaxfyzd487kbhw0lsuzibme1agsx6wh5rvlr9pv0347psadxw9g2f74d7wnuacij4vaj6n5531j7xrg28cizfcc5juqcrvwxkfh1tucoafgbkm13wqeqnjw6vihmmruebfji9内容6, createTime=Fri Jun 10 13:41:47 CST 2022, updateTime=Fri Jun 10 13:41:47 CST 2022, thumbUp=0, visits=0), Article(id=1535135113787084812, userId=1535135113787084813, title=xkmt7no0llcww587sg7z标题7, content=0yy9dg1uq2wks4oceuiggvmj950dvn73ffruc7z4ohylv5zqgxlky1irf8vmwvyi1w5zmapmx9a0h7uxy1eo7cm3iyiheahi9cpw3u2jbjtf91datmmcvd325mcm6p7ndva3asu1bzk0qo2fgnyaf2内容7, createTime=Fri Jun 10 13:41:47 CST 2022, updateTime=Fri Jun 10 13:41:47 CST 2022, thumbUp=0, visits=0), Article(id=1535135113791279104, userId=1535135113791279105, title=kusc9cob7u4wldss849e标题8, content=cskyol7l4it2dausbxjy3tbe40lholas2vckkh29fs9e93i3jf3t01yhbbp19iyh0kmbc294i2xybkdcjjakfvvogn3arz8nc0iwxk0o0k7nphgyigytfsca6030vwq3c1o3tyjgax3dqcnl9ibewv内容8, createTime=Fri Jun 10 13:41:47 CST 2022, updateTime=Fri Jun 10 13:41:47 CST 2022, thumbUp=0, visits=0), Article(id=1535135113791279106, userId=1535135113791279107, title=12aog9fkgvinqk6brivt标题9, content=1iisqm3yriflg5kg5f79aknqdi5g38cfdsux1jkarhsfmx79zfhtb4sanyfalncg13b5tcg82xsj302klr3ag1vnxxx42u6wiru0g5zjovvko7bhp3txztxn9vw6qcii2fhi8id49lkqvl7iuenvv1内容9, createTime=Fri Jun 10 13:41:47 CST 2022, updateTime=Fri Jun 10 13:41:47 CST 2022, thumbUp=0, visits=0), Article(id=1535147409540255744, userId=1535147409540255745, title=lzbcd5h23bovjeekc3aj标题0, content=fd03rrmz25dv78izytrlqr5ex42dwx8mcmwlcisagfwyjk24q7ck0oj6uftkxsimrd8lnob5kshb9qst9ngit5f5h9a96fqe5d190z4x0x0j4c3gafkhqnbm2fscxa8ykkswzd1i25wzeeb64xduyq内容0, createTime=Fri Jun 10 14:30:38 CST 2022, updateTime=Fri Jun 10 14:30:38 CST 2022, thumbUp=0, visits=0), Article(id=1535147409800302592, userId=1535147409800302593, title=0zmll09h0np7ebuhbbgm标题1, content=ia0lkj89ollsa9jk8iy5nximyf4mmv4ta29x8v4pp53l41w9xdvzdqkkitxdh0ocmr76ss0flnhdi2mgvg6h0edmnla55j3oenj303dmjo1zdbhr8iy5n1i54t4credl58ifay26tq0lgt366seohy内容1, createTime=Fri Jun 10 14:30:38 CST 2022, updateTime=Fri Jun 10 14:30:38 CST 2022, thumbUp=0, visits=0), Article(id=1535147409800302594, userId=1535147409800302595, title=krqsivtn3ezbljn1ecse标题2, content=ulp3rt7g5la07xt50arhsddshzsob290paw2lm9lwwfp7bwzz3ajhv5nrbedq452p5yiiyddbh96hiruwtbdsdkwxaf2obykb1sm116ffw280da7f5pnq5neip0vqci9czqdzsijd5gq2t4w98g9zv内容2, createTime=Fri Jun 10 14:30:38 CST 2022, updateTime=Fri Jun 10 14:30:38 CST 2022, thumbUp=0, visits=0), Article(id=1535147409804496896, userId=1535147409804496897, title=qog3zvzjruxjl3n8vp4d标题3, content=xafsxhnw0yudv8txg6pces5akx5epinablnchdqkgxwhuhvajhojhhc1elbhzlsf220ga542mm9it5jrgy8st86k2eujhepggg0d51m5paaejtzy71iuvcjwlmcoiwhquwztc6zcxc62h9upw2a2fw内容3, createTime=Fri Jun 10 14:30:38 CST 2022, updateTime=Fri Jun 10 14:30:38 CST 2022, thumbUp=0, visits=0), Article(id=1535147409804496898, userId=1535147409804496899, title=9wdbupzqfw9e1v809u8f标题4, content=m4obw0g22aj4v0looa5pjhvmo539ldh734so3sagesplvx0etemgf24athenl5jvhyvzhfh70ynm640qqxqx6gbgv6uoifx7ei75z1qz283193a0hzyytl42xt86d9vg60l38o4xb15964ccggbere内容4, createTime=Fri Jun 10 14:30:38 CST 2022, updateTime=Fri Jun 10 14:30:38 CST 2022, thumbUp=0, visits=0), Article(id=1535147409804496900, userId=1535147409804496901, title=l1mo6o3ebf8bulgyglk6标题5, content=gz3i7vmj4mcqpsl2usn542kv9g25mscio6p0q6rxgs0mztfocx1gswa3xgcsh3a4qtlygemalgn1cfex1xbij2j6kic8gfqkfy8ynzep3fv8sp6gn1eovtst2jlkxgdcdbv2cff6bzmgcuqwnppaxn内容5, createTime=Fri Jun 10 14:30:38 CST 2022, updateTime=Fri Jun 10 14:30:38 CST 2022, thumbUp=0, visits=0), Article(id=1535147409804496902, userId=1535147409804496903, title=9p9hivqn1vypkauuifp9标题6, content=uhf1msezlyito1v8jzwd9cd1x0mph2tz1kp5nbf5rzhidsvm3ggjvjru57201myqzvo7riw81rfj8h9ax3ce4pd9buoi9ftfs162vx42jlajz5mfj4kdc2gi6bobubxdse6ge0987sow86o9cjirth内容6, createTime=Fri Jun 10 14:30:38 CST 2022, updateTime=Fri Jun 10 14:30:38 CST 2022, thumbUp=0, visits=0), Article(id=1535147409804496904, userId=1535147409804496905, title=96i2msjasakx8p7yhcmu标题7, content=fgkc093lfwqhp4pl35fp0oonb6npyro0qnkbn0pa02ovryfswb83i3q21ld06taeymal4e7nfn7x5jfb4pn0bb43wox4x5muc4rsxgw2vz20ds43fdfl6gax3xl8dr41g7ykmhgbpagibb9miqv5le内容7, createTime=Fri Jun 10 14:30:38 CST 2022, updateTime=Fri Jun 10 14:30:38 CST 2022, thumbUp=0, visits=0), Article(id=1535147409804496906, userId=1535147409804496907, title=maedrpi7y15r7duryf5t标题8, content=hkit4crgrjuc2pqo9w4iq6twjdqf4525a30x6du40i1pzzogimrexns4t6b1tw0txc5r9ztg0k348n2vskant3t2uq0n87bl5eh0t0s2wjk55zaohix6frklpa7g9glvwq2k5wf7j3fh4unvb89fpq内容8, createTime=Fri Jun 10 14:30:38 CST 2022, updateTime=Fri Jun 10 14:30:38 CST 2022, thumbUp=0, visits=0), Article(id=1535147409804496908, userId=1535147409804496909, title=l1457qtsca6mqbrtzqha标题9, content=x8twi3jl5d8zbqxibtbt3vd143772mhjby4sf0m78g4lpkd8fa2pbo40t000v7yzdm3pvbzxwyouxr5ld5wvzsusw3dadjppc87oft7ggmq2tfbly0zj0pbdymt0op0xcg337c552hemq2imoir6so内容9, createTime=Fri Jun 10 14:30:38 CST 2022, updateTime=Fri Jun 10 14:30:38 CST 2022, thumbUp=0, visits=0), Article(id=1535171979651452928, userId=null, title=null, content=7, createTime=Fri Jun 10 16:08:16 CST 2022, updateTime=Fri Jun 10 16:08:16 CST 2022, thumbUp=9, visits=null), Article(id=1535175023524974592, userId=null, title=null, content=7, createTime=Fri Jun 10 16:20:22 CST 2022, updateTime=Fri Jun 10 16:20:22 CST 2022, thumbUp=9, visits=null), Article(id=1535175698518511616, userId=null, title=null, content=7, createTime=Fri Jun 10 16:23:03 CST 2022, updateTime=Fri Jun 10 16:23:03 CST 2022, thumbUp=9, visits=null), Article(id=1536184056574775296, userId=null, title=null, content=7, createTime=Mon Jun 13 11:09:54 CST 2022, updateTime=Mon Jun 13 11:09:54 CST 2022, thumbUp=9, visits=null)] 

16:20:22 CST 2022, thumbUp=9, visits=null), Article(id=1535175698518511616, userId=null, title=null, content=7, createTime=Fri Jun 10 16:23:03 CST 2022, updateTime=Fri Jun 10 16:23:03 CST 2022, thumbUp=9, visits=null), Article(id=1536184056574775296, userId=null, title=null, content=7, createTime=Mon Jun 13 11:09:54 CST 2022, updateTime=Mon Jun 13 11:09:54 CST 2022, thumbUp=9, visits=null)]


以上是把mongodb数据库的信息输出出来,测试结束。

MongoDB的学习-安装与springboot的整合相关推荐

  1. Nginx安装配置与SpringBoot项目整合

    本篇文章将在上篇<Redis安装与SpringBoot项目整合详细教程>(上文链接:https://blog.csdn.net/sp958831205/article/details/88 ...

  2. 经典再现,看到就是赚到。尚硅谷雷神 - SpringBoot 2.x 学习笔记 -高级与场景整合篇

    SpringBoot 2.x 场景整合 在上一篇核心功能篇里,我们已了解SpringBoot的配置文件.web开发.数据访问.JUnit5单元测试.生产指标监控.SpringBoot启动流程等.然而S ...

  3. Mongodb学习(安装篇): 在centos下的安装

    安装篇 ###下载解压文件 [root@192 lamp]# wget http://fastdl.mongodb.org/linux/mongodb-linux-i686- 2.2.2.tgz ## ...

  4. mongodb简介、安装、启停(转并学习)

    mongodb简介.安装.启停(转并学习)MongoDB是一种强大.灵活以及可扩展的数据存在方式,一种文档数据库,非关系型数据库.1.安装使用安装非常简单,管理简单.2.数据模型mongodb的存在以 ...

  5. MongoDB学习笔记(一) MongoDB介绍及安装

    系列目录 MongoDB学习笔记(一) MongoDB介绍及安装     MongoDB学习笔记(二) 通过samus驱动实现基本数据操作     MongoDB学习笔记(三) 在MVC模式下通过Jq ...

  6. SpringBoot学习笔记(16)----SpringBoot整合Swagger2

    Swagger 是一个规范和完整的框架,用于生成,描述,调用和可视化RESTful风格的web服务 http://swagger.io Springfox的前身是swagger-springmvc,是 ...

  7. Redis 安装配置开机启动整合SpringBoot以及配置文件详解

    安装 Redis # 下载Redis wget https://download.redis.io/releases/redis-6.0.9.tar.gz# 解压 redis tar -zxvf re ...

  8. MonGoDB基础学习(一)之MonGoDB的介绍和安装

    MonGoDB Windows下载安装 https://www.mongodb.com/try/download/community?tck=docs_server 直接下载就行 下载好后进行安装,目 ...

  9. SpringBoot学习笔记(4)----SpringBoot中freemarker、thymeleaf的使用

    1. freemarker引擎的使用 如果你使用的是idea或者eclipse中安装了sts插件,那么在新建项目时就可以直接指定试图模板 如图: 勾选freeMarker,此时springboot项目 ...

最新文章

  1. 实施自动化测试的六个目标和意义
  2. Python打包工具Pyintealler打包py文件为windows exe文件过程及踩坑记录+实战例子
  3. Java 多线程(三) 线程的生命周期及优先级
  4. max232管脚讲解 单片机与PC通讯
  5. 推荐系统第一课 听课记录,边听边打字模式
  6. visual studio 判断dropdownlist选的是什么_测试:选一顶你觉得最漂亮的皇冠。测你长了张什么脸?我是发财脸...
  7. 程序员们,在你当领导前,有些事你得先知道
  8. input标签在谷歌浏览器记住密码下的一个自动填充BUG
  9. 24小时从0到1开发阴阳师小程序
  10. iOS,QRCord(矩阵二维码)
  11. PHP 引用在线编辑器,kindeditor
  12. (论文)Persuading Customers to Buy Early: The Value of Personalized
  13. H5聊天对话气泡的一种实现方式及原理
  14. double值精确到小数点后两位
  15. 在 FPGA 上快速构建 PID 算法
  16. TP-LINK 无线网卡驱动
  17. 使用pyechart生成节点关系图
  18. 升级了鸿蒙资料还在吗,手机升级更新鸿蒙系统会清空数据吗?华为鸿蒙升级需要备份吗...
  19. 计科1111-1114班第三周讲义、课外作业(截止日期:2014年3月27日23点-周四晚,学委飞信通知同学)
  20. 新买的计算机如何检查,新买的笔记本要做哪些检测? 这些你一定要知道

热门文章

  1. 检查nmos管是否损坏
  2. Linux KVM环境搭建,以及创建kvm虚拟机
  3. 佛学研究:人生本相的体察
  4. jqgrid setCell 单元格赋值空字符串 无效处理
  5. 没想到吧!玩游戏还能学习编程,这15款编程游戏你一定要看看
  6. 电池配置(串联和并联)及其保护
  7. Win10连接WiFi显示无internet,安全 却可以正常上网(转)
  8. 《实时控制软件设计》第一次编程作业
  9. 使用rrdtool统计网站PV和IP
  10. 6) 克莱姆(gramer)法则