有一些功能,可以做很长时间的工作,并提供回调.
someFunc: function(argument, callback, context) {
// do something long
// call callback function
callback(context);
}
Run Code Online (Sandbox Code Playgroud)
在应用程序中我使用此功能
someFunc('bla-bla', function (context) {
// do something with this scope
context.anotherFunc();
}, this);
Run Code Online (Sandbox Code Playgroud)
如何在不传递context参数的情况下实现回调函数?
需要这样的:
someFunc('bla-bla', function () {
// do something with this scope
this.anotherFunc();
}, this);
Run Code Online (Sandbox Code Playgroud) 我有单独的开发和生产MongoDB服务器,我想在开发服务器中保留实际数据一段时间.我应该用它:mongodump,mongoimport还是别的什么?
澄清:我想将数据从生产复制到开发.