不粘锅的博客

Centos7安装Postgresql 13

第一步 安装存储库RPM:sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm第二步 安装PostgreSQL

管理员 发布于 2023-07-23

MongoDB创建时间和更新时间的自动更新,以及存储格式问题

最近在写node服务时、遇到创建时间,更新时间每次变更都需要手动去触发更新,在网上搜了一些资料后,看到官网提供了2种方式来解决这个问题方案1以下为官网文档示例 , 我们只需要在new Schema时加一个参数即可const schema = Schema({ createdAt: Number,

管理员 发布于 2022-09-28

centos安装mongodb以及远程连接

安装本文章参考mongodb官网安装说明进行编写,参考地址:https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-red-hat/配置yum源创建文件/etc/yum.repos.d/mongodb-org-4.2.repo,

管理员 发布于 2022-09-25

Mongodb 报 because it is not in your schema. Set the `strictPopulate` option to false

背景今天使用mongodb的populate 方法做外键查询、抛出了路径不对的错误提示解决方案this.model.find().populate({ path: 'pageId', model: 'page', })其中pageId是我当前集合的外键Key、mod

管理员 发布于 2022-09-23

mongodb 插入数据报 Command insert requires authentication

今天使用nodejs连接mongodb并且向mongodb中插入数据,响应结果为 Command insert requires authentication经过排查,最后发现是在创建连接时漏拼参数了正确的拼接格式为mongodb://用户名:密码@host地址:端口/数据库名

管理员 发布于 2022-09-14