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. php redis扩展安装步骤

    因为redis不是php技术自带的技术,因此我们如果要通过php程序来操作redis,需要redis设计者提供对应的操作接口(函数类)我们使用phpredis.tar.gz文件在源码编译生成一个red ...

  2. 微软官方关于 Windows To Go 的常见问题

    Windows To Go:常见问题 2016/04/01 本文内容 什么是 Windows To Go? Windows To Go 是否依赖虚拟化? 哪些人员应该使用 Windows To Go? ...

  3. Centos Docker 安装 Apache Guacamole

    经常在ubuntu上折腾,偶尔在centos来也来玩一把吧 1.安装DOCKER cd /etc/yum.repos.d wget https://download.docker.com/linux/ ...

  4. Bootstrap:UI开发平台 sdk

    Bootstrap:UI开发平台 Bootstrap是一个易用.优雅.灵活.可扩展的前端工具包,里面包含了丰富的Web组件,包括布局.栅格.表格.表单.导航.按钮.进度条.媒体对象等,基于这些组件,可 ...

  5. Git新建分支,分支合并,版本回退详解

    一.git基本命令 git拉取仓库代码 #拉取master代码 git clone git仓库地址 #拉取分支代码 git clone -b 分支名称 git仓库地址 2.git添加代码到本地仓库 g ...

  6. ubuntu开发常用收集

    命令: 1.http://blog.csdn.net/simongeek/article/details/45271089 2.http://www.jianshu.com/p/654be9c0f13 ...

  7. dotnet core 之 CORS使用示例

    这里列举几个经过验证的可用的CORS使用示例, 方便在需要的时候可以直接使用 示例1 #region snippet2 public void ConfigureServices(IServiceCo ...

  8. Angular复习笔记6-依赖注入

    Angular复习笔记6-依赖注入 依赖注入(DependencyInjection)是Angular实现重要功能的一种设计模式.一个大型应用的开发通常会涉及很多组件和服务,这些组件和服务之间有着错综 ...

  9. 聊聊Golang逃逸分析

    逃逸分析的概念,go怎么开启逃逸分析的log. 以下资料来自互联网,有错误之处,请一定告之. 什么是逃逸分析 wiki上的定义 在编译程序优化理论中,逃逸分析是一种确定指针动态范围的方法——分析在程序 ...

  10. Space Syntax(空间句法)

    01 December 2019 13:16     https://spacesyntax.com/     相关软件:Depthmap     空间句法理论作为一种新的描述建筑和城市空间模式的语言 ...