我正在使用节点 JS 。我是初学者。我使用 OrientJS 从 Node JS 连接 orientdb。我想并行运行几个 db.query() 方法。该查询是通过使用逐行模块读取大型文本文件形成的。
例如,
var queryForGeoUpdate = 'update (' +
'\nselect from (' +
"\n select expand(outE('GeoAgentSummary')) " +
'\n from Agent ' +
'\n where name = "' + name + '" and number = \'' + number + "' and type = '" + type + "'" +
"\n) where in.name = '" + Geo + "'" +
'\n) increment _' + FiscalYear + ' = ' + TMSSalesAllocatedBookingsNet + 'f, _' +
FiscalPeriodID + ' = ' + TMSSalesAllocatedBookingsNet +
'f, _' + FiscalQuarterID + ' = ' + TMSSalesAllocatedBookingsNet + 'f'
// console.log(queryForGeoUpdate)
db.query(queryForGeoUpdate) // query and db call for Country ends here
像 db.query(queryForGeoUpdate) 有七个查询像 db.query(queryForRegionUpdate) 等等......
如果我异步运行它“处理内存不足”。如果我同步运行它会花费太多时间。我怎样才能在很短的时间内解决它..
任何帮助表示赞赏..