-1

私は最近phpプログラマーです。プロジェクトを完了するためにnodejsを使用して驚いていますが、残念ながらdynamo dbも使用している可能性があるため、ここで問題が発生しています。それは

実行中のコードはこちら

  if (typeof(req.body.question) == 'object') {
          quest = req.body.question;
        }
        if (typeof(req.body.question) == 'string') {
          quest = req.body.question;
        }else{
          questionsq = {
            'ConsistentRead': true,
            TableName : 'testquestions',
            KeyConditionExpression: "testid = :testid",
            ExpressionAttributeValues: { ":testid":{'S':'f3b21bf0-d6b9-11e8-bdf1-f7fcc44e7f9c'} }
          };
          vulog.info('Question is not settled so querying',questionsq);
          dynamodb.query(questionsq, function(err,quest){
              vulog.info('The data:',JSON.stringify(quest));
              if(err || !quest ){
                  vulog.error('Query went wrong',err);
              }else{
                vulog.info('Query went fine',JSON.stringify(quest));
                //return quest;
              }
          });
        }

この後、このコードが機能することを期待しています。

var originalQuestions = [];
vulog.debug('--------------------');
if (!quest || quest.length == 0) {
  vulog.warn('Questions not entered');
  errstr += '\nAt least one interview question must be entered';
} else {
 //Goes on

現在、端末でこれを取得していますが、そこで動かなくなり、それ以上の実行はありません。

Query went fine {"Items":[{//Datas}],"Count":2,"ScannedCount":2}

私が欲しいのは、コードの最初の部分を実行して、クエストの値を出してから、コードの実行を続行することです。どうすればそれを行うことができますか 現在、実行中であり、そこで立ち往生しています vlog.info('Query going fine',JSON.stringify(quest)); これ以上の実行はありません:)

4

1 に答える 1