identifier(req.body.Counterparty)
.then(() => trade_log.create({
Flag: req.body.Flag,
Instrument: req.body.Instrument,
Venue: req.body.Venue,
Price: req.body.Price,
Currency: req.body.Currency,
Quantity: req.body.Quantity,
Counterparty: req.body.Counterparty,
Identifier: , //надо подставить результат через .this?
Commentary: req.body.Commentary,
}
.catch(function (error) {
console.log('error')
});
let x = identifier(req.body.Counterparty).then(() => trade_log.create({
Flag: req.body.Flag,
Instrument: req.body.Instrument,
Venue: req.body.Venue,
Price: req.body.Price,
Currency: req.body.Currency,
Quantity: req.body.Quantity,
Counterparty: req.body.Counterparty,
Identifier: x,
Commentary: req.body.Commentary,
},function (err, res) {
if (err) return console.log (x) + handleError(err);
console.log(res);
}));
trade_log.create({
Flag: req.body.Flag,
Instrument: req.body.Instrument,
Venue: req.body.Venue,
Price: req.body.Price,
Currency: req.body.Currency,
Quantity: req.body.Quantity,
Counterparty: req.body.Counterparty,
Identifier: identifier(req.body.Counterparty).then(); //т.е. просто функция?
Commentary: req.body.Commentary,
},function (err, res) {
if (err) return console.log (x) + handleError(err);
console.log(res);
}));
let x = имя1(req.body.Counterparty)
.then( return x )
И ключевой вопрос, в Postgres есть аналог insertMany?