1、

var result = db.foo.aggregate(...);
db.bar.insert(result.result);

2、

var temp1 = db.mtb1.find(name:"joe");
while(temp1.hasNext()) db.tab2.insert(temp1.next());
相当于sql中:create table tab2 as select * from mtb1 where name='joe';

MongoDB 实现 create table tab2 as select的更多相关文章

  1. create table xxx as select 与 create table xxx like

    create table xxx )       | NO   | PRI | NULL    | auto_increment | | Name       | varchar() | NO   | ...

  2. hive基本的操作语句(实例简单易懂,create table XX as select XX)

    hive建表语句DML:https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-Cr ...

  3. create table b1 as select * from b建表锁表测试

    A: create table a1 like a; insert into a1 as select * from a; B: create table b1 as select * from b; ...

  4. create table repo_folder_operate_log_bak as select * from repo_folder_operate_log;

    create table repo_folder_operate_log_bak as select * from repo_folder_operate_log;

  5. create table:使用SELECT语句创建表

    oracle下直接(创建表) create table newtablename as select * from oldtablename sqlserver的语法是(自动创建表) : select ...

  6. 用复制方式创建表 Create Table tbname as select * from user.tab where ...

    用复制方式创建表 Create Table tbname as select * from user.tab where ...

  7. create table test_create_table_CreateAs as select * from test_create_table; 表结构的破坏 复制字段结构 复制表结构 LIKE

    案例中: 索引丢失.分区丢失 实际测试 Target Server Type : MYSQLTarget Server Version : 50616File Encoding : 65001 Dat ...

  8. CREATE TABLE 表名 AS SELECT 语句

    1.新表不存在复制表结构即数据到新表 ? 1 2 create table new_table select * from old_talbe; 这种方法会将old_table中所有的内容都拷贝过来, ...

  9. select into 、 insert into select 、create table as select复制表

    Insert是T-sql中常用语句,Insert INTO table(field1,field2,...)  values(value1,value2,...)这种形式的在应用程序开发中必不可少.但 ...

随机推荐

  1. 关于Java单例模式中双重校验锁的实现目的及原理

    开始复习设计模式,一开始理解单例模式中的双重校验锁卡住了,想通了后就自己做了段思维导图来帮助自己理解. 其实理解下来并不难,但还是记录下来帮助自己回忆和借机试试养成写博客的习惯~ public cla ...

  2. Oulipo 子串查找

    题目描述 思路 使用哈希值表示较长串的子串的值,直接比较哈希值是否相等 代码 #include <cstdio> #include <cstring> using namesp ...

  3. Google大数据三篇著名论文中文版

    Google File System中文版 Google MapReduce中文版 Google Bigtable中文版

  4. BZOJ3145 [Feyat cup 1.5]Str 后缀树、启发式合并

    传送门--BZOJCH 考虑两种情况: 1.答案由一个最长公共子串+可能的一个模糊匹配位置组成.这个用SAM求一下最长公共子串,但是需要注意只出现在\(S\)的开头和\(T\)的结尾的子串是不能够通过 ...

  5. Linux命令注释—HDFS运维

    HDFS运维—命令注释 1 实验背景 HDFS是大数据其他组件的基础,Hive的数据存储在HDFS中,Mapreduce.Spark 等计算数据也存储在HDFS 中,HBase 的 region 也是 ...

  6. 服务器同时安装python2支持的py-faster-rcnn以及python3支持的keras

    最近把服务器折腾一下,搞定这两个.

  7. 数据库权限优化,权限设计BigInteger

    最近看到了一个项目的权限是根据bigineger来进行计算的菜单权限,觉得还是不错,存储上只需要存储在一个字段里就可以了,通过计算算出该角色的菜单权限即可,效率也非常的快,放在session中也非常的 ...

  8. C# 多维数组 交错数组的区别,即 [ , ] 与 [ ][ ]的区别 (转载)

    多维数组的声明 在声明时,必须指定数组的长度,格式为 type [lenght ,lenght ,lengh, ... ] , ]; 或声明时即赋值,由系统推断长度 int [,] test1 = { ...

  9. [转]解决ubuntu16.04 ‘E: 无法获得锁 /var/lib/dpkg/lock-frontend - open (11: 资源暂时不可用) ’ 问题

    当运行sudo apt-get install/update/其他命令时,会出现如下提示: E: 无法获得锁 /var/lib/dpkg/lock-frontend - open (11: 资源暂时不 ...

  10. Linux下搭建keepalive+nginx

    一. 安装nginx(略) 二. 安装keepalive 下载http://www.keepalived.org/download.html 安装依赖包 yum install –y popt* gc ...