亲测,下面方法可以实现create table tab1 select * from tab2;

var docs = db.tab1.find({"checked":false}).limit(0,500);

docs.forEach(function(d){db.tab2.insert(d)});

db.tab2.find({"checked":false}).count()

---------------

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

相关文章:

  • 2022-01-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
猜你喜欢
  • 2021-10-07
  • 2022-12-23
  • 2022-12-23
  • 2021-05-21
  • 2021-11-15
相关资源
相似解决方案