当前位置:首页 > 数据库 > 正文

MongoDB 实现 create table tab2 as select

2020-02-13 数据库

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‘;

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/SQL/15984.html