当前位置:网站首页>Mongodb database replication table
Mongodb database replication table
2022-07-28 18:53:00 【Water and moon are clear and bright】
utilize foreach Method in shell Run directly inside
1, Copy the table of one instance to the table of another instance ( The same database )
db.collection_name.find().forEach(function(d){db.getSiblingDB('new_database')['collection_name'].insert(d);})
collection_name: Database table name
new_database: Target database
2, On the same host, the same db Next copy a table
db. Copy source table name .find().forEach(function(x){db. Destination table name .insert(x);})
Example :
db.test.find().forEach(function(x){db.test_bak.insert(x);})
边栏推荐
- How to see the future development of software testing?
- New progress in the implementation of the industry | the openatom openharmony sub forum of the 2022 open atom global open source summit was successfully held
- GC垃圾回收器详解
- 我的创作纪念日 -- 2022年7月25日
- My creation anniversary -- July 25th, 2022
- Ue5 gas learning notes 0.1 case Preview
- 2022.7.26 构造函数,面试:new的作用、深拷贝和浅拷贝
- EasyCVR设备离线后无法再次上线该如何解决?
- EasyNLP中文文图生成模型带你秒变艺术家
- Meta Q2 earnings: revenue fell for the first time, and metaverse will compete with apple
猜你喜欢

配置教程:新版本EasyCVR(v2.5.0)组织结构如何级联到上级平台?

Error 2003 (HY000) can't connect to MySQL server on 'localhost3306' (10061) solution
![[actual combat] realize page distortion correction with OpenCV](/img/7b/7e25bde34a9d5463af3dd40599c80e.png)
[actual combat] realize page distortion correction with OpenCV

不理解模块化、组件化、插件化的区别怎么行?

JVM four reference types

APP为什么用JSON协议与服务端交互:序列化相关知识

My creation anniversary -- July 25th, 2022

N32替换STM32,这些细节别忽略!

UE4.25 Slate源码解读

AI 改变千行万业,开发者如何投身 AI 语音新“声”态
随机推荐
Bubble sorting and Related videos
LeetCode_343_整数拆分
Pyqt5 rapid development and practice 5.3 multithreading
Three minutes to understand, come to new media
行业落地呈现新进展 | 2022开放原子全球开源峰会OpenAtom OpenHarmony分论坛圆满召开
Ue5 gas learning notes 1.5 gameplay effects game effects
408复习策略(强化阶段)
Go concurrency one
Ue5 gas learning notes 1.4 attribute set
AI 改变千行万业,开发者如何投身 AI 语音新“声”态
使用自开发的代理服务器解决 SAP UI5 FileUploader 上传文件时遇到的跨域访问错误试读版
New upgrade! The 2022 white paper on cloud native architecture was released
MYSQL入门与进阶(八)
湖上建仓全解析:如何打造湖仓一体数据平台 | DEEPNOVA技术荟系列公开课第四期
One Hot编码是什么?为什么要用它,什么时候用它?
How to solve the problem that easycvr device cannot be online again after offline?
LeetCode_1137_第N个泰波那契数
直播平台软件开发,js实现按照首字母排序
LeetCode_ 96_ Different binary search trees
Is it really realistic that people who have not been exposed to software testing can take up their posts after two months of training?