[root@localhost ~]# docker exec -it mongodb mongosh
Current Mongosh Log ID: 66a99c147066bd635ba48ced
Connecting to: mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.10.6
Using MongoDB: 7.0.0
Using Mongosh: 1.10.6For mongosh info see: https://docs.mongodb.com/mongodb-shell/------The server generated these startup warnings when booting2024-07-30T10:58:29.512+00:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted2024-07-30T10:58:29.513+00:00: /sys/kernel/mm/transparent_hugepage/enabled is 'always'. We suggest setting it to 'never'2024-07-30T10:58:29.513+00:00: /sys/kernel/mm/transparent_hugepage/defrag is 'always'. We suggest setting it to 'never'2024-07-30T10:58:29.513+00:00: vm.max_map_count is too low
------test>
atguigu> db.myCollection.insert({name:'小明',age:20})
DeprecationWarning: Collection.insert() is deprecated. Use insertOne, insertMany, or bulkWrite.{acknowledged: true,insertedIds:{'0':ObjectId("66a99e507066bd635ba48cef")}}
atguigu>
4、查看数据库列表
atguigu> show dbs
admin 40.00 KiB
atguigu 40.00 KiB
config 96.00 KiB
local 72.00 KiB
5、查看集合
atguigu> show collections
myCollection
6、显示创建集合
atguigu> db.createCollection("myCollection2"){ ok:1}
atguigu> show collections
myCollection
myCollection2
7、删除集合
atguigu> db.myCollection2.drop()
true
atguigu> show collections
myCollection
Vue中按需引入Element-plus时,报错TypeError: Components is not a function。
1、参考Element-plus官方文档
安装unplugin-vue-components 和 unplugin-auto-import这两款插件
2、然后需要在vue.config.js中配置webPack打包plugin配置 3、重新启动项目会报错
T…